文件名称:lc
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:67.84kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
引用原作者:这个类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/
sample/array.c
sample/deletefile.c
sample/gcd.c
sample/lc.exe
sample/lclib.h
sample/swap.c
source/
source/lc.dsp
source/mk.bat
source/src/
source/src/config.h
source/src/const.c
source/src/error.c
source/src/expr.c
source/src/gen.c
source/src/lc.h
source/src/lib.c
source/src/lib.h
source/src/main.c
source/src/parse.h
source/src/parse.y
source/src/scan.h
source/src/scan.l
source/src/stdafx.h
source/src/sym.c
source/src/tree.c
source/src/vm.c
source/src/vm.h
license-BSD.txt
readme.txt
sample/array.c
sample/deletefile.c
sample/gcd.c
sample/lc.exe
sample/lclib.h
sample/swap.c
source/
source/lc.dsp
source/mk.bat
source/src/
source/src/config.h
source/src/const.c
source/src/error.c
source/src/expr.c
source/src/gen.c
source/src/lc.h
source/src/lib.c
source/src/lib.h
source/src/main.c
source/src/parse.h
source/src/parse.y
source/src/scan.h
source/src/scan.l
source/src/stdafx.h
source/src/sym.c
source/src/tree.c
source/src/vm.c
source/src/vm.h
license-BSD.txt
readme.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.