摘要
介绍了教学编译程序实例的设计思想和语法规则,并着重对主程序、分程序和几个功能性程序给予了详细分析.本编译程序取标准PASCAL的一个典型子集作为编译对象.词法分析中使用了超前搜索和状态转换图;语法分析中使用了算符优先分析法和递归下降分析法;中间代码是四元式;查表方式是折半查找.这些技术同样也适用于处理标准PAS-CAL和其它程序设计语言书写的源程序.
This paper introduces the design idea and the syntax of a Compiler used in teaching with focus on the analysis of the main program,block and several functional program.This compiler takes a typical subset of the standard PASCAL as the compiling object.The lead search and state transform diagram are used in the lexical analysis.The operator precedence parsing and recursive descent parsing are used in the syntax analysis and the intermediate code is quadruples.Binary search is used in searching tables.These technologies are also suitable for standard PASCAL and the source code written in other programming languages.
出处
《沈阳工业学院学报》
1998年第2期29-34,共6页
Journal of Shenyang Institute of Technology
关键词
编译程序
语法图
主程序
分程序
教学
compiler,syntax digran,main program,block,symblic tables.