LR1 syntax analyzer in《Compiler principle》 implemented by c, hope it will be help for learning.
Implementation function: Generating state machine closures and goto tables. Syntax state machine visualization,generated html path: analyzer/demo/view.html
And two simple examples of the implementation based on it:
- The positive integer calculator: analyzer/example/calculator
- Regular expression: analyzer/example/regular_expression You can just make and run the test.exe file.
《编译原理》中LR1语法分析器的c语言简单实现,方便个人学习理解。 实现功能: 生成状态机闭包和goto表格。 基于g6的文法状态机可视化,生成html路径:analyzer/demo/view.html 以及其基础上实现的两个简单案例: 1.正整数计算器:analyzer/example/calculator 2.正则表达式:analyzer/example/regular_expression 可以直接make运行test.exe文件。