文件名称:lexical-analyzer
-
所属分类:
- 标签属性:
- 上传时间:2015-04-16
-
文件大小:2.59mb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编译原理实验报告
实验一:词法分析器
实验目的:
实现TINY+语言的词法分析程序(扫描程序)
实验内容:
1、词法分析器输入输出
扫描程序的输入是源代码文件,输出是token串。
2、需要遵循“最长串匹配原则”,如匹配字符串‘:=’ 为赋值操作符,而不是冒号和等号两个操作符。
Token 以键值对 (Kind, Value)的形式表示。下面的符号表示不同的token类别(即Kind的取值)
KEY 表示保留字
SYM 表示特殊符号
ID 表示标识符
NUM 表示数值常数
STR 表示字符串常数
3、检测词法错误:给出有意义的错误信息和错误发生的行号。
-Compile a report principle experiment to experiment: lexical analyzer experimental purposes: to achieve lexical analysis program TINY+ language (scanner) Experiment: a lexical analyzer Input Output Scan program source code file, the output is token string. 2, you need to follow the " longest string matching principle" , such as matching the string ' : =' is the assignment operator instead of a colon and equals two operators. Token expressed as key-value pairs (Kind, Value) format. The following token symbols represent different categories (ie Kind values) KEY expressed reservations expressed special symbol SYM word identifier ID NUM represents a numerical value represents the string constant constant STR 3, the detection lexical error: give meaningful error messages and line number the error occurred.
实验一:词法分析器
实验目的:
实现TINY+语言的词法分析程序(扫描程序)
实验内容:
1、词法分析器输入输出
扫描程序的输入是源代码文件,输出是token串。
2、需要遵循“最长串匹配原则”,如匹配字符串‘:=’ 为赋值操作符,而不是冒号和等号两个操作符。
Token 以键值对 (Kind, Value)的形式表示。下面的符号表示不同的token类别(即Kind的取值)
KEY 表示保留字
SYM 表示特殊符号
ID 表示标识符
NUM 表示数值常数
STR 表示字符串常数
3、检测词法错误:给出有意义的错误信息和错误发生的行号。
-Compile a report principle experiment to experiment: lexical analyzer experimental purposes: to achieve lexical analysis program TINY+ language (scanner) Experiment: a lexical analyzer Input Output Scan program source code file, the output is token string. 2, you need to follow the " longest string matching principle" , such as matching the string ' : =' is the assignment operator instead of a colon and equals two operators. Token expressed as key-value pairs (Kind, Value) format. The following token symbols represent different categories (ie Kind values) KEY expressed reservations expressed special symbol SYM word identifier ID NUM represents a numerical value represents the string constant constant STR 3, the detection lexical error: give meaningful error messages and line number the error occurred.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lexical analyzer/
lexical analyzer/Debug/
lexical analyzer/Debug/exp1.exe
lexical analyzer/Debug/exp1.ilk
lexical analyzer/exp1/
lexical analyzer/exp1.sdf
lexical analyzer/exp1.sln
lexical analyzer/exp1.v12.suo
lexical analyzer/exp1/Debug/
lexical analyzer/exp1/exp1.vcxproj
lexical analyzer/exp1/exp1.vcxproj.filters
lexical analyzer/exp1/src.cpp
lexical analyzer/文档.doc
lexical analyzer/Debug/
lexical analyzer/Debug/exp1.exe
lexical analyzer/Debug/exp1.ilk
lexical analyzer/exp1/
lexical analyzer/exp1.sdf
lexical analyzer/exp1.sln
lexical analyzer/exp1.v12.suo
lexical analyzer/exp1/Debug/
lexical analyzer/exp1/exp1.vcxproj
lexical analyzer/exp1/exp1.vcxproj.filters
lexical analyzer/exp1/src.cpp
lexical analyzer/文档.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.