An Approach to Design a Compiler in Context of Lexical Analyzer (Scanner) and Parser Generation (Parser) Followed by Non-optimized Intermediate Code Generation using Compiler Construction Tools
DOI:
https://doi.org/10.37591/jospa.v1i1.16Keywords:
Tokens, Lexeme, Lex, AST, YaccAbstract
It is very tedious and lengthy task to write a compiler. To realize the various phases of compilers we can use some specific tools. These tools are called compiler construction tools. Furthermore, we call it as compiler-compiler, compiler-generators, or translator writing system. A mixture of compiler building tools are Scanner generator —it generates lexical analyzers. The patterns specified to these generators are in the type of regular expressions. The LINUX has utility for a scanner generator called LEX. The specification given to the LEX consists of regular expressions for representing various tokens. Parser generators — these produce the syntax analyzer. The specification given to these generators is given in the form of CFG. Typically LINUX has a tool called YACC, which is a parser generator. Syntax-directed translation engines — in this tool the parse tree is scanned fully to generate an intermediate code. The translation is done for each node of the tree.
References
Alfred V. Aho, Ravi Sethi, Jeffery D. Ullman, Compilers- Principles, Techniques, and Tools: Addison-Wesley; 2007.
William A. Barrett, Compiler Design, CmpE 152, FALL Version, San Jose State University; 2005.
G.M6nier, G. Lorette, Lexical Analyzer based on a Self-Organizing Feature Map, IEEE Xplore. 1997. 0-8186-7898-4.
Lex, Yacc, UNIX Programming/UNIX Utilities. 2nd Edn; John R. Levine, Tony Mason and Doug Brown–O’Reilly (Ed.): ISBN 1-56592-000-7.
Jeffrey E.F. Friedl–O’Reilly, Mastering Regular Expressions. 1997, ISBN: 1-56592-257-3.
William M. Waite, Assad Jarrahian, Michele H. Jackson, Amer Diwan, 2006. Design and Implementation of a Modern Compiler Course, ACM 1595930558/06/0006.
K.L.P. Mishra, N.Chandrasekharan, Theory of Computer Science 2007, 3rd Edn., PHI.
Downloads
Published
Issue
Section
License
Declaration and Copyright Transfer Form
(to be completed by authors)
I/ We, the undersigned author(s) of the submitted manuscript, hereby declare, that the above manuscript which is submitted for publication in the STM Journals(s), is not published already in part or whole (except in the form of abstract) in any journal or magazine for private or public circulation, and, is not under consideration of publication elsewhere.
- I/We will not withdraw the manuscript after 1 week of submission as I have read the Author Guidelines and will adhere to the guidelines.
- I/We Author(s ) have niether given nor will give this manuscript elsewhere for publishing after submitting in STM Journal(s).
- I/ We have read the original version of the manuscript and am/ are responsible for the thought contents embodied in it. The work dealt in the manuscript is my/ our own, and my/ our individual contribution to this work is significant enough to qualify for authorship.
- I/We also agree to the authorship of the article in the following order:
Author’s name
1. ________________
2. ________________
3. ________________
4. ________________
| We Author(s) tick this box and would request you to consider it as our signature as we agree to the terms of this Copyright Notice, which will apply to this submission if and when it is published by this journal. |