能力值:
( LV2,RANK:10 )
|
-
-
[原创] LL(1) 语法分析器解析算数表达式生成AST,和我学习编译的原因
我写过词法分析器,LALR的语法分析器。做研究可以。利用所学的东西做分析其他东西也没问题,如果真要去实现编译器,估计作者不行,不是所智力不行。很多条件制约,而且性能优化要花很长时间。我的LALR语法分析器分析实际的C程序语法并生成AST要近5分钟,而别人的几秒。优化的差距不是一点点。后面的制导翻译,中间代码生成,指令选择,寄存器选择,优化问题,难度不是一点点。如果有单位支撑,如果有经费,可以搞。 当年的豪情都没了,可能我老了。希望后来者有更好的条件,更大的决心。 鼓励一下的是:我现在对源代码、二进制代码、或任一规范语法文件的分析工具编写都比较自信了。
|
能力值:
( LV2,RANK:10 )
|
-
-
|