文件名称:LexicalAnalyzer
介绍说明--下载内容均来自于网络,请自行研究使用
手工构造一个能够识别C语言的所有典型单词,如:标识符、数字、运算符,和if、while等保留字的确定有限自动机,并写出对应该自动机的程序;然后以一个简化的C语言程序为输入文件,通过所设计的基于上述自动机的词法分析程序获得输入文件中的各个单词及其内码对照表,并以文件形式保存结果(也就是TOKEN序列)。
将自己定义的各个正则表达式转化为NFA,然后将其综合为NFA ,再将NFA 转化为DFA,再将DFA转化为最少状态的DFA ,最后由DFA 转化为词法分析程序。-Manually construct a C language to identify all the typical words such as: identifiers, numbers, operators, and if, while the determination of reserved words such as finite automata, and write on the procedure should be automatic machine then a simplified C language program for the input file, through the design of automata based on the lexical analysis procedure for obtaining the input file and within each code word table, and save the results to file the form (that is, TOKEN sequence). Defining themselves in all the regular expression into NFA, and then consolidated for the NFA ' , then NFA' into a DFA, DFA then converted to a minimum state DFA ' , the last by the DFA' into a lexical analysis program.
将自己定义的各个正则表达式转化为NFA,然后将其综合为NFA ,再将NFA 转化为DFA,再将DFA转化为最少状态的DFA ,最后由DFA 转化为词法分析程序。-Manually construct a C language to identify all the typical words such as: identifiers, numbers, operators, and if, while the determination of reserved words such as finite automata, and write on the procedure should be automatic machine then a simplified C language program for the input file, through the design of automata based on the lexical analysis procedure for obtaining the input file and within each code word table, and save the results to file the form (that is, TOKEN sequence). Defining themselves in all the regular expression into NFA, and then consolidated for the NFA ' , then NFA' into a DFA, DFA then converted to a minimum state DFA ' , the last by the DFA' into a lexical analysis program.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Lexical Analyzer.cpp
Lexical Analyzer.doc
Lexical Analyzer.doc