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

Support