文件名称:lexicalanalysis
- 所属分类:
- 编译器/词法分析
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2008-10-13
- 文件大小:
- 10.45kb
- 下载次数:
- 0次
- 提 供 者:
- ho***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
为了实现的编译程序实用,源程序可采用自由书写格式,即一行内可以书写多个语句,一个语句也可以占领多行书写;标识符的前20个字符有效;整数用2个字节表示;长整数用4个字节表示。这样词法分析程序的主要工作为:
(1)从源程序文件中读入字符。
(2)统计行数和列数用于错误单词的定位。
(3)删除空格类字符,包括回车、制表符空格。
(4)按拼写单词,并用(种别,单词)二元式表示。
(5)根据需要是否填写标识符表供以后各阶段使用。
这里采用的编译程序的实现方法是一遍扫描,即从左到右只扫描一次源程序,也就是词法分析作为语法分析的一个子程序。故在编写词法分析程序时,用重复调用词法分析子程序取一单词的方法得到整个源程序的二元式流。
-in order to achieve the compiler practical, available free to write source code format, that his writing can be more than words, a statement can occupy multiple lines written; identifier of 20 characters effective; Integer with two byte; long integer with four byte. This lexical analysis for major work : (1) from source document read into the characters. (2) Statistics and a few mistakes out a few words for positioning. (3) delete the blank type characters, including the carriage return, tab spaces. (4) the spelling words and use (other species, words) dual ceremony. (5) whether the need for completing the table identifier subsequent stages. Here the compilers of this method is again scanned, the scanning time from left to right only source files, is a lexical analysis as a grammatical ana
(1)从源程序文件中读入字符。
(2)统计行数和列数用于错误单词的定位。
(3)删除空格类字符,包括回车、制表符空格。
(4)按拼写单词,并用(种别,单词)二元式表示。
(5)根据需要是否填写标识符表供以后各阶段使用。
这里采用的编译程序的实现方法是一遍扫描,即从左到右只扫描一次源程序,也就是词法分析作为语法分析的一个子程序。故在编写词法分析程序时,用重复调用词法分析子程序取一单词的方法得到整个源程序的二元式流。
-in order to achieve the compiler practical, available free to write source code format, that his writing can be more than words, a statement can occupy multiple lines written; identifier of 20 characters effective; Integer with two byte; long integer with four byte. This lexical analysis for major work : (1) from source document read into the characters. (2) Statistics and a few mistakes out a few words for positioning. (3) delete the blank type characters, including the carriage return, tab spaces. (4) the spelling words and use (other species, words) dual ceremony. (5) whether the need for completing the table identifier subsequent stages. Here the compilers of this method is again scanned, the scanning time from left to right only source files, is a lexical analysis as a grammatical ana
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 5956466lexicalanalysis.rar 列表 lexicalanalysis lexicalanalysis\lexical analysis.cpp lexicalanalysis\lexical analysis.dsp lexicalanalysis\lexical analysis.dsw lexicalanalysis\lexical analysis.ncb lexicalanalysis\lexical analysis.opt lexicalanalysis\lexical analysis.plg lexicalanalysis\lexical.dc lexicalanalysis\old.cpp lexicalanalysis\source.pas lexicalanalysis\Debug