Parser processes the main program and units, checks syntax, processes stream of tokens and generates intermediate code. This is where the core compiler functions are located.

This procedure processes Pascal declarations: Constants, Types, Variables, Procedures, Functions, and if declarations are not in the Interface part of the unit, also Lables, Constructors and Destructors are processed. Before declarations are processes, statement compiler switches are reset to module compiler switches. This procedure is called from program compilation, unit interface and implementation compilation and …

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. Therefore, typed constant values are stored into a separate symbol table.

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 – identifiers that denote types. 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. This procedure is used also to process types in variable declarations, ordinal types …

Turbo Pascal includes many functions and procedures to process object type declaration. The reason is in the complexity of object type. It can contain fields, methods, constructors, destructors, private and public members, static methods, dynamic methods, virtual methods, etc.

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. The first procedure processes header.

Processing Label declarations is trivial. They are simply stored into symbol table as identifiers.

This is where the 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). After the compilation, module entry and exit code is added. Of course, for …