文件名称:wordanalysis
介绍说明--下载内容均来自于网络,请自行研究使用
、该个词法分析器要求至少能够识别以下几类单词:
a. 关键字:else if int return void while共6个,所有的关键字都是保留字,并且必须是小写;
b. 标识符:识别与C语言词法规定相一致的标识符,通过下列正则表达式定义:ID = letter (letter | digit)*;
c. 常数:NUM=(+ | - |ε)digit digit*(.digit digit* |ε)(e(+ | - |ε) digit digit* |ε),letter = a|..|z|A|..|Z|,digit = 0|..|9,包括整数,如123, -123, +123等;小数,如123.45, +123.45, -123.45;科学计数法表示的常数,如+1.23e3,-2.3e-9;
d. 专用符号:+ - * / < <= > >= == != = , ( ) [ ] { } /* */;
-, Which require at least a lexical analyzer can identify the following types of words: a. Keyword: else if int return void while a total of six, all keywords are reserved words and must be lowercase b. Identifier: Identification and C language provides consistent lexical identifiers, through the definition of the following regular expression: ID = letter (letter | digit)* c. Constants: NUM = (+ |- | Ε) digit digit* (. Digit digit* | ε) (e (+ |- | Ε) digit digit* | ε), letter = a | .. | z | A | .. | Z |, digit = 0 | .. | 9, including integer, such as 123,-123,+ 123, etc. decimals, such as 123.45,+ 123.45,-123.45 science express constant counting method, such as+ 1.23e3,-2.3e-9 d. Special symbols:+-*/
a. 关键字:else if int return void while共6个,所有的关键字都是保留字,并且必须是小写;
b. 标识符:识别与C语言词法规定相一致的标识符,通过下列正则表达式定义:ID = letter (letter | digit)*;
c. 常数:NUM=(+ | - |ε)digit digit*(.digit digit* |ε)(e(+ | - |ε) digit digit* |ε),letter = a|..|z|A|..|Z|,digit = 0|..|9,包括整数,如123, -123, +123等;小数,如123.45, +123.45, -123.45;科学计数法表示的常数,如+1.23e3,-2.3e-9;
d. 专用符号:+ - * / < <= > >= == != = , ( ) [ ] { } /* */;
-, Which require at least a lexical analyzer can identify the following types of words: a. Keyword: else if int return void while a total of six, all keywords are reserved words and must be lowercase b. Identifier: Identification and C language provides consistent lexical identifiers, through the definition of the following regular expression: ID = letter (letter | digit)* c. Constants: NUM = (+ |- | Ε) digit digit* (. Digit digit* | ε) (e (+ |- | Ε) digit digit* | ε), letter = a | .. | z | A | .. | Z |, digit = 0 | .. | 9, including integer, such as 123,-123,+ 123, etc. decimals, such as 123.45,+ 123.45,-123.45 science express constant counting method, such as+ 1.23e3,-2.3e-9 d. Special symbols:+-*/
(系统自动生成,下载前可以参看下载内容)
下载文件列表
wordanalysis.txt