文件名称:lab2
-
所属分类:
- 标签属性:
- 上传时间:2015-12-18
-
文件大小:27.28kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
任务是在词法分析和语法分析程序的基础上编写一个程序,对C 源代码进行语义分析和类型检查,并打印分析结果。与实验一不同的是,实验二不再借助已有的工具,所有的任务都必须手写代码来完成。另外,虽然语义分析在整个编译器的实现中并不是难度最大的任务,但却是最细致、琐碎的任务。因此需要用心地设计诸如符号表、变量类型等数据结构的实现细节,从而正确、高效地实现语义分析的各种功能。
需要注意的是,由于在后面的实验中还会用到本次实验已经写好的代码,因此保持一个良好的代码风格、系统地设计代码结构和各模块之间的接口对于整个实验来讲相当重要。 -Task was to prepare the basis of lexical analysis and syntax analysis program on a program source code for C semantic analysis and type checking, and print the results. The first experiment is different, no longer by means of experiment two existing tools, all tasks must be done hand-written code. In addition, although the semantic analysis is not the most difficult task in the whole compiler implementation, but it is the most detailed, trivial task. Therefore it needs careful design implementation details such as the symbol table, variable types of data structures, which correctly and efficiently implement various functions of semantic analysis.
It should be noted that, due later in the experiment will be used in this experiment has been written code, so keeping the interface between a good coding style, system design and code structure for each module in terms of the whole experiment quite important.
需要注意的是,由于在后面的实验中还会用到本次实验已经写好的代码,因此保持一个良好的代码风格、系统地设计代码结构和各模块之间的接口对于整个实验来讲相当重要。 -Task was to prepare the basis of lexical analysis and syntax analysis program on a program source code for C semantic analysis and type checking, and print the results. The first experiment is different, no longer by means of experiment two existing tools, all tasks must be done hand-written code. In addition, although the semantic analysis is not the most difficult task in the whole compiler implementation, but it is the most detailed, trivial task. Therefore it needs careful design implementation details such as the symbol table, variable types of data structures, which correctly and efficiently implement various functions of semantic analysis.
It should be noted that, due later in the experiment will be used in this experiment has been written code, so keeping the interface between a good coding style, system design and code structure for each module in terms of the whole experiment quite important.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
code/data_structure.c
code/data_structure.h
code/lexical.l
code/main.c
code/parser
code/syntax.y
code/treenode.c
code/treenode.h
code
code/data_structure.h
code/lexical.l
code/main.c
code/parser
code/syntax.y
code/treenode.c
code/treenode.h
code
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.