文件名称:lex
介绍说明--下载内容均来自于网络,请自行研究使用
设计并实现 C 语言的词法分析程序,要求如下。
(1) 可以识别出用C语言编写的源程序中的每个单词符号,并以记号的形式输出每个单词符号。
(2) 可以识别并读取源程序中的注释。
(3) 可以统计源程序中的语句行数、单词个数和字符个数,其中标点和空格不计算为单词,并输出统计结果。
(4) 检查源程序中存在的非法字符错误,并可以报告错误所在的行列位置。
(5) 发现源程序中存在错误后,进行适当的恢复,使词法分析可以继续进行,通过一次词法分析处理,可以检查并报告源程序中存在的所有词法拼写错误。-Design and implementation of C language lexical analysis procedures, requirements are as follows. (1) can be identified using the C language source code for each word symbols, and mark each word in the form of output symbols. (2) can recognize and read the comments in the source program. (3) you can count the number of rows in the source program statements, the number of words and number of characters, including punctuation and spaces are not counted as words, and output statistics. (4) Check the source of the illegal character errors exist, and can report the error location where the ranks. (5) found that there are errors in the source after proper recovery, so that lexical analysis can proceed through a lexical analysis process, you can check and report the source of all existing lexical spelling errors.
(1) 可以识别出用C语言编写的源程序中的每个单词符号,并以记号的形式输出每个单词符号。
(2) 可以识别并读取源程序中的注释。
(3) 可以统计源程序中的语句行数、单词个数和字符个数,其中标点和空格不计算为单词,并输出统计结果。
(4) 检查源程序中存在的非法字符错误,并可以报告错误所在的行列位置。
(5) 发现源程序中存在错误后,进行适当的恢复,使词法分析可以继续进行,通过一次词法分析处理,可以检查并报告源程序中存在的所有词法拼写错误。-Design and implementation of C language lexical analysis procedures, requirements are as follows. (1) can be identified using the C language source code for each word symbols, and mark each word in the form of output symbols. (2) can recognize and read the comments in the source program. (3) you can count the number of rows in the source program statements, the number of words and number of characters, including punctuation and spaces are not counted as words, and output statistics. (4) Check the source of the illegal character errors exist, and can report the error location where the ranks. (5) found that there are errors in the source after proper recovery, so that lexical analysis can proceed through a lexical analysis process, you can check and report the source of all existing lexical spelling errors.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lex.cpp