期刊文献+

GPJ_Pascal集成开发坏境——词法分析、语法分析、语义分析和中间代码生成

GPJ_Pascal 集成开发坏境——词法分析、语法分析、语义分析和中间代码生成
下载PDF
导出
摘要 GPJ_Pascal是PASCAL的一个子集。GPJ_Pascal集成开发环境是编辑、编译和执行GPJ_Pascal程序的平台,具有可视化的用户界面。本文主要介绍了GPJ_Pascal编译器的构造,其中,词法分析器扫描源程序,根据语言的词法规则,分解和识别出每个单词,同时进行词法检查;语法分析器以词法分析器生成的符号表为基础,验证单词符号串序列是否是语言文法的一个句子;在分析过程中,符号表被频繁地用来建立表项、查找表项、填充和引用表项;语法分析子程序采用了自上而下的递归子程序法,在语法分析的同时,也根据程序的语义生成有利于程序移植的相应三元式代码,并提供了出错处理的机制。GPJ_Pascal编译器总体结构完整、清晰,含义明确、易读、易理解,出错少,可靠性大,并易于对GPJ_Pascal的词法和语法进行扩充。 GPJ_Pascal is a subset of Pascal. GPJ_Pascal Integrated Development Environment is a platform with a visual user's interface,and the GPJ_Pascal program can be edited, compiled and performed. In the paper, the structure of the GPJ_Pascal compiler is mainly introduced,the lexer can scan the source program according to the morphology rule of language which can decompose and distinguish every word, and carry out morphology inspection at the same time; the parser is the basis of the symbol table generated by verifying whether a word symbol string is a sentence of the language grammar or not; in analysis process, the item is utilized to establish, seek, fill and reference form frequently; the parse subprogram has adopted top-bottom recursive subprogram law while parsing, it also generates the corresponding triple code according to the semantic, which is helpful for program transplant, and offers mistaken handle mechanism. The overall structure of the GPJ_Pascal compiler is complete, distinct, clear meaning, easily reading and understanding, compiling fewer mistakes, big reliability, and easily expanding the morphology and grammar.
作者 张弦 原庆能
出处 《广西工学院学报》 CAS 2005年第S3期86-89,共4页 Journal of Guangxi University of Technology
关键词 词法分析 语法分析 符号表 三元式 lexer parser symbol table triple
  • 相关文献

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部