Journal of Advances in Shell Programming

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

  1. Partha Ghosh ✉

Abstract

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.

Keywords

References (7)

  1. Alfred V. Aho, Ravi Sethi, Jeffery D. Ullman, Compilers- Principles, Techniques, and Tools : Addison-Wesley; 2007.
  2. William A. Barrett, Compiler Design , CmpE 152, FALL Version, San Jose State University; 2005.
  3. G.M6nier, G. Lorette, Lexical Anal yzer based on a Self -Organizing Feature Map, IEEE Xplore. 1997. 0-8186-7898-4.
  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.
  5. Jeffrey E.F. Friedl –O’Reilly, Mastering Regular Expressions . 1997, ISBN: 1 - 56592-257-3.
  6. William M. Waite, Assad Jarrahian, Michele H. Jackson, Amer Diwan, 2006. Design and Implementation of a Modern Compiler Course , ACM 1595930558/06/0006.
  7. K.L.P. Mishra, N.Chandrasekharan, Theory of Computer Science 2007, 3rd Edn., PHI.

Read more of it

Subscribe to one journal or build your own list of several. One invoice, one payment, access for a full year.

Subscribe to journals →

Publish your article

Peer-reviewed journals across every subject, with open access options. Send your manuscript to the right editor today.

Publish with us → Calculate your APC
Support