Font Size: a A A

OCCL Compiler For Linux

Posted on:2004-07-18Degree:MasterType:Thesis
Country:ChinaCandidate:X Y GuoFull Text:PDF
GTID:2168360125470130Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
This project aims to design a small optimizing C compiler based on Linux. The compiler can translate C language code into IBM 8088 assembly language. OCCL is the acronym of Optimizing C Compiler for Linux.There are some important motivations for this project. First, compiler is a very important and complicated program. Deep understanding to compiler theory can be developed through designing a C compiler. Second, C is a common procedure language that has much common with object-oriented languages. It can help to know well about the ways of designing a compiler for object-oriented languages. Third, the target code is a VMC machine code(Virtual Machine Code) which was defined by ourselves. This technology can make OCCL compiler has the character of independent of machines.OCCL compiler includes three passes. The first pass is lexical analysis and syntax analysis procedure. The second pass acts as semantic analyzer and intermediate code generator. The last pass completes target code and its optimization. These make the compiler featured by a clear structure and easy-to-use optimizing method. As a result, the generated target codes have a good quality. The complete OCCL compiler can correctly compile programs conforming to a specific ANSI C language subset. In addition, in each model, new theory and new method is taken advantage of to make OCCL equipped with its own characteristics and strongpoint. For example, hash table technology of level-separate-corresponding method is used to develop symbol table, which improves the seeking speed of the compiler. In the process of generating target code, What's more, a virtual machine is designed. Virtual machine code is generated at first and then has the interpretive execution to get the result. In such a way, OCCL is easy to transplanted to different target machines.
Keywords/Search Tags:compiler, lexical analysis, syntax analysis, semantic analysis, intermediate code, target code
PDF Full Text Request
Related items