Tag archive for "type"

Here are presented data structures that describe types in Turbo Pascal. All types belong to one of base Turbo Pascal types: Untyped, Array, Record, Object, File, Text, Function/Procedure, Set, Pointer, String, Extended, Real, Integer, Boolean, Char, Enumeration.

Here are listed all Turbo Pascal elementary types that are defined in the System unit (using the boot-strap symbol table SYSTEM.TPS).

Array and set definitions use few functons for type checking.

This procedure converts expression between compatible types. For example, Integer values can be assigned to Real variables, only the expression and type need to be converted.

This procedure checks type compatibility between expression and specified type and sets expression to the specified type if needed.

Turbo Pascal sometimes needs to convert number types. Integer and Real can be used as Extended and Integer or Extended can be used as Real.

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 …

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.