文件名称:lab1
介绍说明--下载内容均来自于网络,请自行研究使用
任务是编写一个程序对使用C 语言书写的源代码进行词法分析和语法分析(C 语言的文法参见附录A),并打印分析结果。实验要求使用词法分析工具GNU Flex和语法分析工具GNU Bison,并使用C语言来完成。在两个强大工具的帮助下,编写一个能进行词法分析和语法分析的程序是一件相当轻松愉快的事情。
需要注意的是,由于在后面的实验中还会用到本次实验已经写好的代码,因此保持一个良好的代码风格、系统地设计代码结构和各模块之间的接口对于整个实验来讲相当重要。 -The task is to write a program using C language source code written in lexical analysis and syntax analysis (see C language grammar Appendix A), and print the results. Experiments require the use of tools GNU Flex lexical analysis and parsing tools GNU Bison, and use the C language to complete. With the help of two powerful tools, the preparation of a capable lexical analysis and parsing program is a very pleasant thing.
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.
需要注意的是,由于在后面的实验中还会用到本次实验已经写好的代码,因此保持一个良好的代码风格、系统地设计代码结构和各模块之间的接口对于整个实验来讲相当重要。 -The task is to write a program using C language source code written in lexical analysis and syntax analysis (see C language grammar Appendix A), and print the results. Experiments require the use of tools GNU Flex lexical analysis and parsing tools GNU Bison, and use the C language to complete. With the help of two powerful tools, the preparation of a capable lexical analysis and parsing program is a very pleasant thing.
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.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
parser
syntax.y
treenode.c
treenode.h
lexical.l
main.c