所属分类:
编译器/解释器
开发工具:Others
文件大小:144KB
下载次数:104
上传日期:2004-06-19 18:19:08
说明: 一. 实验目的: 设计、编写和调试一个具体的词法分析程序,加深对词法分析理论和自动词法分析工具的理解、实践和掌握。 二. 实验要求: ① 学习和理解正则表达式理论,写出C—语言的记号的完整的正则表达式;(适当使用正则定义) ② 学习和理解有限机理论,根据前面的正则表达式,用基于经验的方法画出C—语言的记的DFA图; ③ 用基于DFA图的算法编写C—语言的词法分析程序; ④ 学习词法分析程序的自动生成工具,使用LEX工具实现C—语言的词法分析程序.
( 1. Experimental goal: The design, compiles and debugs a
concrete lexical analyaer, deepens to the lexical analysis theory and
the automatic lexical analysis tool understanding, practices and
grasps. 2. The experiment requests: (1) study and the understanding
regular expression theory, writes the C 鈻anguage the symbol
integrity regular expression; (Suitable use regular definition) (2)
study and the understanding limited machine theory, according to the
front regular expression, with draw the DFA chart based on the
experience method which the C 鈻anguage records; (3) uses based on
the DFA chart algorithm to compile the C 鈻anguage the lexical
analyaer; (4) study lexical analyaer automatic production tool, uses
the LEX tool to realize the C 鈻anguage lexical analyaer)