文件名称:lex
-
所属分类:
- 标签属性:
- 上传时间:2013-10-21
-
文件大小:3.16kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
设计并实现 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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.