ABSTRACT

A compiler is a program that reads a program in one language-the source language-and translates it into an equivalent program in another language-the target language [1]. It may generate an error or warning report if the source program has problems, lexical, syntactical, or semantic. Source languages are usually high-level languages, such as Java or C/C++, while their target languages could be machine or assembly languages depending on different requirements. The traditional structure of compilers consists of some or all of the following phases: lexical analysis, syntax analysis, semantics analysis, intermediate code generation, optimization, and target code generation, where the input of each phase comes from the output of its previous phase except for the first one whose input is the source program.