Skip to content

HavenTong/CompilerPrinciples-Lab

Repository files navigation

CompilerPrinciples-Lab

🚀 ​Labs of Compiler Principles, including 4 parts:

  • Lexical Analysis
  • LL(1)
  • LR(1)
  • Semantic Analysis

🚀 LL(1) Parser Generator.pdf and SLR Parser Generator.pdf are generated from Online LL / SLR / LR Generator, which is strongly recommended.

Lab1-Lexical Analysis

  • Symbol Table is defined in LexAnalysis/c_keys.txt
  • Source Code is in LexAnalysis/LexAnalysis.h
  • Transition Diagram:

CompilePrinciplePlot.001

CompilePrinciplePlot.001

CompilePrinciplePlot.002

CompilePrinciplePlot.004

CompilePrinciplePlot.005

Lab 2 - LL(1)

The analysis table is computed manually. However, I stronglly recommend using the online generator mentioned above.

image-20200703204500925

Lab 3 - LR(1)

The analysis table is in SLR Parser Generator.pdf.

Lab 4 - Semantic Analysis

The analysis table is in LL(1) Parser Generator.pdf. I did the translation schema during LL(1) procedure.

About

Labs of Compiler Principles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published