文件名称:cifa
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.56kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
完成下述文法所描述的单词符号的词法分析程序,文法如下:
<标识符>--><字母>|<标识符><字母>|<标识符><数字>
<无符号整数>--><数字>|<无符号整数><数字>
<分界符>-->+|-|*|/| |(|)|{|}|<|<=|=|!=|>=|>|:=|<空格>
<字母>-->a|…|z|A|…|Z
<数字>-->0|…|9
<空格>-->’ ’
说明:
(1) 假定该语言对字母的大小写不敏感,由指定文件读入预分析的源程序,分析结果再写入指定文件;
(2) 假定语言的关键字为"begin","if","end","else","then","for","while","to","do","and","not","or","write";
(3)本程序规定输出用KeyWord代表关键字,Word代表普通标识符,Digit代表阿拉伯数字,SingleWord代表单分界符,DoubleWord代表双分界符,ERROR代表无法识别的字符。
-Complete the following grammar describes the word s lexical analysis program symbols, the grammar is as follows:
<Identifier >-->< letter> | <identifier> <letter> | <identifier> <number>
<Unsigned integer >-->< number> | <unsigned int> <number>
<Delimiter >-->+|-|*|/| |(|)|{|}|<|<=|=|!=|>=|>|:=|< spaces>
<Letter>-> a | ... | z | A | ... | Z
<Number>-> 0 | ... | 9
<Space >-->
Descr iption:
(1) assumes that the language of the letters are not case sensitive, specify the file read by the pre-analysis of the source code analysis and then write to the specified file
(2) assumes that the language of the keyword "begin", "if", "end", "else", "then", "for", "while", "to", "do", "and", " not "," or "," write "
(3) The procedural requirements on behalf of output with KeyWord keyword, Word on behalf of common identifiers, Digit behalf of the Arab figures, SingleWor
<标识符>--><字母>|<标识符><字母>|<标识符><数字>
<无符号整数>--><数字>|<无符号整数><数字>
<分界符>-->+|-|*|/| |(|)|{|}|<|<=|=|!=|>=|>|:=|<空格>
<字母>-->a|…|z|A|…|Z
<数字>-->0|…|9
<空格>-->’ ’
说明:
(1) 假定该语言对字母的大小写不敏感,由指定文件读入预分析的源程序,分析结果再写入指定文件;
(2) 假定语言的关键字为"begin","if","end","else","then","for","while","to","do","and","not","or","write";
(3)本程序规定输出用KeyWord代表关键字,Word代表普通标识符,Digit代表阿拉伯数字,SingleWord代表单分界符,DoubleWord代表双分界符,ERROR代表无法识别的字符。
-Complete the following grammar describes the word s lexical analysis program symbols, the grammar is as follows:
<Identifier >-->< letter> | <identifier> <letter> | <identifier> <number>
<Unsigned integer >-->< number> | <unsigned int> <number>
<Delimiter >-->+|-|*|/| |(|)|{|}|<|<=|=|!=|>=|>|:=|< spaces>
<Letter>-> a | ... | z | A | ... | Z
<Number>-> 0 | ... | 9
<Space >-->
Descr iption:
(1) assumes that the language of the letters are not case sensitive, specify the file read by the pre-analysis of the source code analysis and then write to the specified file
(2) assumes that the language of the keyword "begin", "if", "end", "else", "then", "for", "while", "to", "do", "and", " not "," or "," write "
(3) The procedural requirements on behalf of output with KeyWord keyword, Word on behalf of common identifiers, Digit behalf of the Arab figures, SingleWor
(系统自动生成,下载前可以参看下载内容)
下载文件列表
词法分析器.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.