文件名称:lexical_analysis_program
介绍说明--下载内容均来自于网络,请自行研究使用
编译原理、词法分析程序。
题目:词法分析程序的设计和实现
实验内容:设计并实现C语言的词法分析程序,要求如下。
(1)可以识别出用C语言编写的源程序中的每个单词符号,并以记号的形式输出每个单词符号。
(2)可以识别并读取源程序中的注释。
(3)可以统计源程序中的语句行数、单词个数和字符个数,其中标点和空格不计算为单词,并输出统计结果。
(4)检查源程序存在的错误,并可以报告错误所在的行列位置。
(5)发现源程序中存在错误后,进行适当的恢复,使词法分析可以继续进行,通过一次词法分析处理,可以检查并报告源程序中存在的所有错误。
实现要求:
采用C/C++作为实现语言,手工编写词法分析程序。
-Compiler theory lexical analysis program. Title: lexical analysis program design and implementation of experimental content: the design and realization of C language lexical analyzer requirements are as follows. (1) can identify each word in the C language source code symbols, and outputs of each word to the mark in the form of symbols. (2) can identify and read the comments in the source code. (3) Statistical statement the number of rows in the source code, the number of words and the number of characters, including punctuation and spaces does not count as a word, and output of the statistical results. (4) Check the source error, and can report the error where the ranks of the position. (5) found that there is an error in the source program, proper recovery, lexical analysis can proceed through a lexical analysis processing, you can check and report all errors in the source. Requirements: adopt the C/C++ as the implementation language, hand-written lexical analyzer.
题目:词法分析程序的设计和实现
实验内容:设计并实现C语言的词法分析程序,要求如下。
(1)可以识别出用C语言编写的源程序中的每个单词符号,并以记号的形式输出每个单词符号。
(2)可以识别并读取源程序中的注释。
(3)可以统计源程序中的语句行数、单词个数和字符个数,其中标点和空格不计算为单词,并输出统计结果。
(4)检查源程序存在的错误,并可以报告错误所在的行列位置。
(5)发现源程序中存在错误后,进行适当的恢复,使词法分析可以继续进行,通过一次词法分析处理,可以检查并报告源程序中存在的所有错误。
实现要求:
采用C/C++作为实现语言,手工编写词法分析程序。
-Compiler theory lexical analysis program. Title: lexical analysis program design and implementation of experimental content: the design and realization of C language lexical analyzer requirements are as follows. (1) can identify each word in the C language source code symbols, and outputs of each word to the mark in the form of symbols. (2) can identify and read the comments in the source code. (3) Statistical statement the number of rows in the source code, the number of words and the number of characters, including punctuation and spaces does not count as a word, and output of the statistical results. (4) Check the source error, and can report the error where the ranks of the position. (5) found that there is an error in the source program, proper recovery, lexical analysis can proceed through a lexical analysis processing, you can check and report all errors in the source. Requirements: adopt the C/C++ as the implementation language, hand-written lexical analyzer.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
编译原理词法分析程序\main.cpp.cpp
....................\main.h.h
编译原理词法分析程序