Jump to content

Compiler frontend

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 142.76.1.62 (talk) at 18:55, 6 February 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The frontend of a compiler translates human readable source code into an intermediate representation.

A compiler frontend analyzes the source code to build an internal representation of the program, called the intermediate representation or IR. It also manages the symbol table, a data structure mapping each symbol in the source code to associated information such as location, type and scope. The frontend of a compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis (Syntax-directed translation), code generation, and code optimization.

Program faults caused by incorrect compiler behavior can be very difficult to track down and work around; therefore, compiler implementors invest significant effort to ensure the correctness of their software.




Overview

Parsing

Compiler Frontend Output