文件名称:PL0_Compiler
- 所属分类:
- 编译器/词法分析
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 230kb
- 下载次数:
- 0次
- 提 供 者:
- 郭**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
Pl/0.h文件:头文件主要定义了常量,另外还定义了比较重要的枚举值,还有两个重要的结构体类型,最后还对函数进行了声明,总的来说,头文件的主要工作就是声明或定义了.cpp文件中需要用到的变量。
Pl/0.cpp文件:按照程序从main()函数开始的原则,我们一一作分析。
首先,主函数提示输入要打开的pl/0文件,因为我们需要对一个pl/0语言进行分析。接着,程序提示是否列出token文件,然后提示是否列出目标代码,继续提示是否列出符号列表,最后将文件以只读的形式放在一个新的txt格式的fa1文件中,接下来就进行初始化函数。将err置为0,当函数中发生fatal error 时,返回-1告知调用它的函数,最终退出程序,然后将行,列计数器都初始化为0,虚拟机代码指针置为0。以只读的方式打开ftoken.txt文件,调用listtoken函数进行词法分析输出。最后将文件关闭。-
Pl/0.h files: the main header file defines constants, in addition to the more important definition of the enumeration values, there are two important types of structures and, finally, a statement of function, in general, header files The main job is declared or defined. cpp files need to use variables.
Pl/0.cpp file: According to the program from main () function begins the principle, we one by one for analysis.
First of all, the main function prompted to open the pl/0 file because we need a pl/0 language analysis. Then, the program prompts the token file is listed, then prompts object code is listed, continue to prompt a list of symbols is listed, the last file read-only form on a new format fa1 txt file, then the conduct initialization function. To err is set to 0, when the function fatal error occurs, it returns-1 this function called it, eventually quit the program, then the row and column counters are initialized to 0, the virtual machine code pointer is set to 0. Ftoken.txt
Pl/0.cpp文件:按照程序从main()函数开始的原则,我们一一作分析。
首先,主函数提示输入要打开的pl/0文件,因为我们需要对一个pl/0语言进行分析。接着,程序提示是否列出token文件,然后提示是否列出目标代码,继续提示是否列出符号列表,最后将文件以只读的形式放在一个新的txt格式的fa1文件中,接下来就进行初始化函数。将err置为0,当函数中发生fatal error 时,返回-1告知调用它的函数,最终退出程序,然后将行,列计数器都初始化为0,虚拟机代码指针置为0。以只读的方式打开ftoken.txt文件,调用listtoken函数进行词法分析输出。最后将文件关闭。-
Pl/0.h files: the main header file defines constants, in addition to the more important definition of the enumeration values, there are two important types of structures and, finally, a statement of function, in general, header files The main job is declared or defined. cpp files need to use variables.
Pl/0.cpp file: According to the program from main () function begins the principle, we one by one for analysis.
First of all, the main function prompted to open the pl/0 file because we need a pl/0 language analysis. Then, the program prompts the token file is listed, then prompts object code is listed, continue to prompt a list of symbols is listed, the last file read-only form on a new format fa1 txt file, then the conduct initialization function. To err is set to 0, when the function fatal error occurs, it returns-1 this function called it, eventually quit the program, then the row and column counters are initialized to 0, the virtual machine code pointer is set to 0. Ftoken.txt
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PL0_Compiler\Debug\PL0_Compiler.bsc
............\.....\PL0_Compiler.exe
............\.....\PL0_Compiler.ilk
............\.....\PL0_Compiler.obj
............\.....\PL0_Compiler.pch
............\.....\PL0_Compiler.pdb
............\.....\PL0_Compiler.sbr
............\.....\StdAfx.obj
............\.....\vc60.idb
............\.....\vc60.pdb
............\pl0.h
............\PL0_Compiler.cpp
............\PL0_Compiler.dsp
............\PL0_Compiler.dsw
............\PL0_Compiler.ncb
............\PL0_Compiler.opt
............\PL0_Compiler.plg
............\ReadMe.txt
............\StdAfx.cpp
............\StdAfx.h
............\Debug
PL0_Compiler
............\.....\PL0_Compiler.exe
............\.....\PL0_Compiler.ilk
............\.....\PL0_Compiler.obj
............\.....\PL0_Compiler.pch
............\.....\PL0_Compiler.pdb
............\.....\PL0_Compiler.sbr
............\.....\StdAfx.obj
............\.....\vc60.idb
............\.....\vc60.pdb
............\pl0.h
............\PL0_Compiler.cpp
............\PL0_Compiler.dsp
............\PL0_Compiler.dsw
............\PL0_Compiler.ncb
............\PL0_Compiler.opt
............\PL0_Compiler.plg
............\ReadMe.txt
............\StdAfx.cpp
............\StdAfx.h
............\Debug
PL0_Compiler