文件名称:lc
- 所属分类:
- 编译器/词法分析
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 68kb
- 下载次数:
- 1次
- 提 供 者:
- Eli***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
引用原作者:这个类C编译器是我在2008年写的,完成度并不高,并没有实现指针、struct这些,不过还是实现了基本的C语言数据类型(int/char/long/short等),函数的声明、定义、调用、递归,if/for/while/goto等跳转,详细请看sample和source。
为了节省开发的时间,词法和语法分析分别采用lex和yacc编写,可以用Cygwin里面的flex和bison进行编译。另外我觉得编译成x86的bytecode比较麻烦,所以定义了一套自己的bytecode,以及写了一个虚拟机(叫模拟器更准确)去执行它,这部分是比较好修改的,而且我生成的bytecode要比x86的指令体系精简,也跟平台无关,可能适合移植到一些对运行环境要求较苛刻的地方。-Reference to the original author: This class C compiler is written in 2008, to complete the degree is not high, and did not realize the pointer to the struct, but still achieve the basic C data types (int/char/long/short, etc. ), the function declaration, definition, call, recursive, and if/for/while/a goto, etc. Jump in detail please see the sample and the source. In order to save development time, lexical and syntax analysis were used lex and yacc to write, can be compiled with Cygwin inside the flex and bison. In addition, I think compiled into x86 bytecode is too much trouble, so to define its own set of bytecode, and write a virtual machine (called the simulator is more accurate) to execute it, this part is modified, but I generated bytecode than x86 instructions to streamline the system, also has nothing to do with the platform, may be suitable for transplantation to the harsh operating environment requirements.
为了节省开发的时间,词法和语法分析分别采用lex和yacc编写,可以用Cygwin里面的flex和bison进行编译。另外我觉得编译成x86的bytecode比较麻烦,所以定义了一套自己的bytecode,以及写了一个虚拟机(叫模拟器更准确)去执行它,这部分是比较好修改的,而且我生成的bytecode要比x86的指令体系精简,也跟平台无关,可能适合移植到一些对运行环境要求较苛刻的地方。-Reference to the original author: This class C compiler is written in 2008, to complete the degree is not high, and did not realize the pointer to the struct, but still achieve the basic C data types (int/char/long/short, etc. ), the function declaration, definition, call, recursive, and if/for/while/a goto, etc. Jump in detail please see the sample and the source. In order to save development time, lexical and syntax analysis were used lex and yacc to write, can be compiled with Cygwin inside the flex and bison. In addition, I think compiled into x86 bytecode is too much trouble, so to define its own set of bytecode, and write a virtual machine (called the simulator is more accurate) to execute it, this part is modified, but I generated bytecode than x86 instructions to streamline the system, also has nothing to do with the platform, may be suitable for transplantation to the harsh operating environment requirements.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
sample
......\array.c
......\deletefile.c
......\gcd.c
......\lc.exe
......\lclib.h
......\swap.c
source
......\lc.dsp
......\mk.bat
......\src
......\...\config.h
......\...\const.c
......\...\error.c
......\...\expr.c
......\...\gen.c
......\...\lc.h
......\...\lib.c
......\...\lib.h
......\...\main.c
......\...\parse.h
......\...\parse.y
......\...\scan.h
......\...\scan.l
......\...\stdafx.h
......\...\sym.c
......\...\tree.c
......\...\vm.c
......\...\vm.h
license-BSD.txt
readme.txt
......\array.c
......\deletefile.c
......\gcd.c
......\lc.exe
......\lclib.h
......\swap.c
source
......\lc.dsp
......\mk.bat
......\src
......\...\config.h
......\...\const.c
......\...\error.c
......\...\expr.c
......\...\gen.c
......\...\lc.h
......\...\lib.c
......\...\lib.h
......\...\main.c
......\...\parse.h
......\...\parse.y
......\...\scan.h
......\...\scan.l
......\...\stdafx.h
......\...\sym.c
......\...\tree.c
......\...\vm.c
......\...\vm.h
license-BSD.txt
readme.txt