Location:
Search - flex LC
Search list
Description: flex+lcds实例,适合初学者学习FLEX和LCDS,描述了FLEX与LCDS构建的基本框架。-flex+ lcds instance, suitable for beginners to learn FLEX and LCDS, describes the FLEX and LCDS to build the basic framework.
Platform: |
Size: 7168 |
Author: 樱空 |
Hits:
Description: 引用原作者:这个类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.
Platform: |
Size: 69632 |
Author: Elijah |
Hits: