Parser processes main program and units, checks syntax, processes stream of tokens and generates intermediate code. This is where the core compiler functions are located.
|
Turbo Pascal constants can be of two types: ordinary constants which are only stored to the symbol table and typed constants which are also embedded into the program.
|
This procedure processes and stores the value of typed constants. For complex types like Arrays, Records and Objects recursion is used to process elements and fields.
|
This procedure processes type declarations. Object types have their own processing.
|
This procedure processes all types except Objects and creates type definition records. One one hand objects need different and more complex processing and on the other hand they can not be declared anywhere else as in the program, interface or implementation part.
|
Turbo Pascal includes many functions and procedures to process object type declaration. The reason is in the complexity of object type.
|
This procedure expects a list of identifiers followed by a colon and variable type and processes declaration of variables: global, local and absolute.
|
Turbo Pascal uses few procedures to process declaration of procedures and functions. The same code is also used to process methods, constructors and destructors.
|
This is where main compilation routines are called. This procedure resets many compiler flags and variables, initializes intermediate code, saves source line number, resets compiler switches, and processes statements between begin and end tokes (or asm and end for assembler procedures).
|
|
|
|