Designing a compiler of proposed source language Using LEX and BISON


Abstract in English

This paper proposes an approach for compiler construction of a proposed source language consisting of all computational and logical operations control statements loops declarations and assignment operations. This study is based on many steps starting from lexical analysis (Scanner) depending on LEX environment; after that, the syntax analysis step is done to obtain the syntax analyzer (Parser) which defines the grammar rules. The final step is compiling the parser using Turbo C++ to get the final output. The designed compiler has been tested on 100 source files, and the results show that the designed program compiles all these source files correctly .In addition it defines the error’s locations through them.

References used

A.V. AHO, R. SETHI, J.D. ULLMAN,“Compilers: Principles, Techniques and Tools”, Addison-Wesley, 1986
ANTHONY A. AABY, “Compiler Construction using Flex and Bison”, Walla Walla College, February 25, 2004, pp:1-18
F.J.F. BENDERSET AL., “Compiler Construction A Practical Approach”, Macmillan Technical Publishing, January 29, 2003, pp:21-16
J. Levine, “Lex and Yacc”, O'Reilly & sons, 2000
P.H. SALUS,“Handbook of Programming Languages, Volume I: Object oriented Programming Languages”, Macmillan Technical Publishing, 1998

Download