CS 1104 Introduction to Computer Science
COMPILERS AND TRANSLATORS
The five stages of a compiler combine to translate a high level language to a low level language, generally closer to that of the target computer. Each stage, or sub-process, fulfills a single task and has one or more classic techniques for implementation.
Analyzes the Source Code
Finite State Machines
Amalgamates symbols into syntactic groups
Tags groups with type information
Fills in assumed or missing information
Tags groups with meaning information
Ad hoc analyzers
** The Symbol Table is the data structure that all elements of the compiler use to collect and share information about symbols and groups of symbols in the program being translated.
Check your understanding of the structure of a compiler.
|The textbook in use with this course, and several other elementary texts, promulgate the mistaken concept that a compiler translates a program in a high level language to assembly language and thence to machine language. While this is sometimes the case it is by no means the most common. Programming languages are frequently accompanied by well defined intermediate languages as the target of compilation - e.g. "p-code" for Pascal, and "byte-code" for Java. Thus the only requirement for a compiler is that it translates from one programming language to another. Generally this translation is between a high level language and a lower level language.|
© J.A.N. LEE
Last Updated 2001/04/09