这是编译原理的LL1语法分析器,VB编写,内附三个测试例子和一份实验报告
本书系统介绍了经典的编译理论和技术,同时也包含了面向对象语言等当前较新语言的编译技术。本书更可贵之处在于提供了较完整的适用于教学实践的样例语言,是一本理论和实践内容相结合的、不可多得的好书。 本书可用作大专院校教材、教师参考书以及编译器研究人员的参考资料。
编译原理双语书 Moving on to the code generation, the goal of this phase is to build a compiler given that the programs in the phase of parser have been strictly recognized without any error, here the error means that the input is an illegal sentence in the grammar. However, before generating code, first you need to build the bar-bones recognizer.
We need create some temporary variables and maintain internally by the compiler. The step of generating Code is as follows. First, create a mechanism for allocating temporaries. In fact, the temporaries should be recycled, that is they should be reused after they are no longer needed in the current subexpression. Second, determine the name of the temporary that uses arguments and return values. So, this section of code generator consists of generating code for a binary operator, generating code for a copy instruction, generating code for an instruction which loads the argument into a register, and then write it onto the new stack frame, including the standard call sequence and the standard return sequence.