Definition
A compailer acceepts aprogram writen in a highlevel languages as input and produces its machine language equivalent as output .
General model of compailer
In analysing the compilation of our simple pl/program w e found distinct logical problems as follows
1. Lexical analsys- recognitio of basic elements and ceratin of uniform symbols
2. Sysnax analysis- recgonition of syntactic constructs through reductions
3. Implementation-definition of exat meanings creatin of matrix and tables by action routines
4. Machine independent optimization-creation of more optimal matrix
5. Storage assignment- modification of identifier and literal tables.it makes entries in matrix that allow code generation to creat code that allocates dynamic storage,and also allow the assembly phase to reserve the proper amounts of STATIC storsge.
6. Code generation-use of macro processor to produce more optimal assembly langage.
7. Assembly and output-resolving symbolic addresses(lables)and generating machine language.
Databases which are used by the compailer
A. Source code- in our example the PL/I program
B. Uniform symbol table –consist of full or partial list of the tokens’as they appear in the program. created by lexical analysis and used for syntax analysis and interpretation
C. Terminal table- a permanent table which lists all key words and specal symbols of language in symbolic form
D. Identifier table –contans all veriables in the program and temparary storage and any information needed to reference or allocate storage of them ;created by lexical analysis,modified by interpretation and storage allocation,and referenced by code generation and assembly.the table may also cotains information of all temparary locations that the compailer creates for use during execution of the source program
E. Literal table-contains all constants in the program creation and use similar to D above.
F. Reductions –permanent table of decision rules in the form of