Difference between revisions of "Symbol entries"

From Lazarus wiki
 
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
{{Symbol_entries}}
 +
 
back to contents [[FPC internals]]
 
back to contents [[FPC internals]]
  
Line 4: Line 6:
  
 
== Architecture ==
 
== Architecture ==
''(last updated for fpc version 1.0.x)''
+
 
 +
{{Warning|Last updated for FPC version 1.0.x}}
  
 
There are different possible types of symbols, each one having different fields then the others. Each symbol type has a specific signature to indicate what kind of entry it is. Each entry in the symbol table is actually one of the symbol entries described in the following sections. The relationship between a symbol entry, a type definition, and the type name symbol entry is shown in the following figure:
 
There are different possible types of symbols, each one having different fields then the others. Each symbol type has a specific signature to indicate what kind of entry it is. Each entry in the symbol table is actually one of the symbol entries described in the following sections. The relationship between a symbol entry, a type definition, and the type name symbol entry is shown in the following figure:
  
http://www.pjh2.de/fpc/CompilerInternalsFigure05.png
+
http://www.pjh2.de/fpc/CompilerInternalsFigure06.png
  
 
== Symbol entry types ==
 
== Symbol entry types ==
''(last updated for fpc version 1.0.x)''
+
 
 +
{{Warning|Last updated for FPC version 1.0.x}}
  
 
=== Base symbol type (TSym) ===
 
=== Base symbol type (TSym) ===
Line 18: Line 22:
 
the symbol type as well as information on the owner of this symbol entry.
 
the symbol type as well as information on the owner of this symbol entry.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PSym = ^TSym;
 
   PSym = ^TSym;
   TSym = <b>object</b>(TSymTableEntry)
+
   TSym = object(TSymTableEntry)
 
     SymOptions: TSymOptions;  // Indicate the access scope of the symbol
 
     SymOptions: TSymOptions;  // Indicate the access scope of the symbol
 
     FileInfo: TFilePosInfo;
 
     FileInfo: TFilePosInfo;
Line 33: Line 38:
 
     IsStabWritten: Boolean;  // Set to TRUE if the stabs debugging information has
 
     IsStabWritten: Boolean;  // Set to TRUE if the stabs debugging information has
 
                               // been written for this symbol.
 
                               // been written for this symbol.
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
{| border="1" cellpadding="3" cellspacing="0"
+
{| class="wikitable"
! style="background:#f0f0f0;text-align:left;" | TSymTyp
+
! TSymTyp !! Description
! style="background:#f0f0f0;text-align:left;" | Description
 
 
|-
 
|-
 
| AbstractSym || This is a special abstract symbol (this should never occur)
 
| AbstractSym || This is a special abstract symbol (this should never occur)
Line 72: Line 77:
 
|}
 
|}
  
=== label symbol (TLabelSym) ===
+
=== Label symbol (TLabelSym) ===
  
 
The label symbol table entry is only created when a pascal label is declared via the label keyword. The object has the following fields which are available for use publicly:
 
The label symbol table entry is only created when a pascal label is declared via the label keyword. The object has the following fields which are available for use publicly:
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PLabelSym = ^TLabelSym;
 
   PLabelSym = ^TLabelSym;
   TLabelSym = <b>object</b>(TSym)
+
   TLabelSym = object(TSym)
 
     Used: Boolean;                // Set to TRUE if this pascal label is used using a goto
 
     Used: Boolean;                // Set to TRUE if this pascal label is used using a goto
 
                                   // or in an assembler statement
 
                                   // or in an assembler statement
Line 85: Line 91:
 
                                   // will be emitted by the code generator
 
                                   // will be emitted by the code generator
 
     Code: Pointer;
 
     Code: Pointer;
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
  
=== unit symbol (TUnitSym) ===
+
=== Unit symbol (TUnitSym) ===
  
 
The unit symbol is created and added to the symbol table each time that the uses clause is parsed and a unit name is found, it is also used when compiling a unit, with the first entry in that symbol table being the unit name being compiled. The unit symbol entry is actual part of a linked list which is used in the unit symbol table.
 
The unit symbol is created and added to the symbol table each time that the uses clause is parsed and a unit name is found, it is also used when compiling a unit, with the first entry in that symbol table being the unit name being compiled. The unit symbol entry is actual part of a linked list which is used in the unit symbol table.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PUnitSym = ^TUnitSym;
 
   PUnitSym = ^TUnitSym;
   TUnitSym = <b>object</b>(TSym)
+
   TUnitSym = object(TSym)
 
     UnitSymTable: PUnitSymTable;  // Pointer to the global symbol table for that
 
     UnitSymTable: PUnitSymTable;  // Pointer to the global symbol table for that
 
                                   // unit, containing entries for each public?
 
                                   // unit, containing entries for each public?
 
                                   // symbol in that unit
 
                                   // symbol in that unit
 
     PrevSym: PUnitSym;            // Pointer to previous entry in the linked list
 
     PrevSym: PUnitSym;            // Pointer to previous entry in the linked list
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
=== macro symbol (TMacroSym) ===
+
=== Macro symbol (TMacroSym) ===
  
 
The macro synbols are used in the preprocessor for conditional compilation statements. There is one such entry created for each $define directive, it contains the value of the define (stored as a string).
 
The macro synbols are used in the preprocessor for conditional compilation statements. There is one such entry created for each $define directive, it contains the value of the define (stored as a string).
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PMacroSym = ^TMacroSym;
 
   PMacroSym = ^TMacroSym;
   TMacroSym = <b>object</b>(TSym)
+
   TMacroSym = object(TSym)
 
     Defined: Boolean;              // TRUE if the symbol has been defined with a  
 
     Defined: Boolean;              // TRUE if the symbol has been defined with a  
 
                                   // $define directive, or false if it has been  
 
                                   // $define directive, or false if it has been  
Line 116: Line 126:
 
     BufText: PChar;                // The actual string text of the define
 
     BufText: PChar;                // The actual string text of the define
 
     BufLength: Longint;            // The actual string length of the define
 
     BufLength: Longint;            // The actual string length of the define
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
=== error symbol (TErrorSym) ===
+
=== Error symbol (TErrorSym) ===
  
 
This symbol is actually an empty symbol table entry. When the parser encounters an error when parsing a symbol, instead of putting nothing in the symbol table, it puts this symbol entry. This avoids illegal memory accesses later in parsing.
 
This symbol is actually an empty symbol table entry. When the parser encounters an error when parsing a symbol, instead of putting nothing in the symbol table, it puts this symbol entry. This avoids illegal memory accesses later in parsing.
  
=== procedure symbol (TProcSym) ===
+
=== Procedure symbol (TProcSym) ===
  
 
The procedure symbol is created each time a routine is defined in the code. This can be either a forward definition or the actual implementation of the routine. After creation, the symbol is added into the appropriate symbol table stack.
 
The procedure symbol is created each time a routine is defined in the code. This can be either a forward definition or the actual implementation of the routine. After creation, the symbol is added into the appropriate symbol table stack.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PProcSym = ^TProcSym;
 
   PProcSym = ^TProcSym;
   TProcSym = <b>object</b>(TSym)
+
   TProcSym = object(TSym)
 
     Is_Global: Boolean;          // Set if the routine is exported by the unit
 
     Is_Global: Boolean;          // Set if the routine is exported by the unit
 
     Definition: PProcDef;        // Procedure definition, including parameter  
 
     Definition: PProcDef;        // Procedure definition, including parameter  
 
                                   // information and return values
 
                                   // information and return values
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
=== type symbol (TTypeSym) ===
+
=== Type symbol (TTypeSym) ===
  
 
The type symbol is created each time a new type declaration is done, the current symbol table stack is then inserted with this symbol. Furthermore, each time the compiler compiles a module, the default base types are initialized and added into the symbol table (psystem.pas) The type symbol contains the name of a type, as well as a pointer to its type definition.
 
The type symbol is created each time a new type declaration is done, the current symbol table stack is then inserted with this symbol. Furthermore, each time the compiler compiles a module, the default base types are initialized and added into the symbol table (psystem.pas) The type symbol contains the name of a type, as well as a pointer to its type definition.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PTypeSym = ^TTypeSym;
 
   PTypeSym = ^TTypeSym;
   TTypeSym = <b>object</b>(TSym)
+
   TTypeSym = object(TSym)
 
     ResType: TType;              // Contains base type information as well as the type
 
     ResType: TType;              // Contains base type information as well as the type
 
                                   // definition
 
                                   // definition
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
=== variable symbol (TVarSym) ===
+
=== Variable symbol (TVarSym) ===
  
 
Variable declarations, as well as parameters which are passed onto routines are declared as variable symbol types. Access information, as well as type information and optimization information are stored in this symbol type.
 
Variable declarations, as well as parameters which are passed onto routines are declared as variable symbol types. Access information, as well as type information and optimization information are stored in this symbol type.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PVarSym = ^TVarSym;
 
   PVarSym = ^TVarSym;
   TVarSym = <b>object</b>(TSym)
+
   TVarSym = object(TSym)
 
     Reg: TRegister;              // If the value is a register variable, the reg field will
 
     Reg: TRegister;              // If the value is a register variable, the reg field will
 
                                 // be different then R_NO
 
                                 // be different then R_NO
Line 166: Line 182:
 
     VarState: TVarState;        // Indicates the state of the variable, if it’s used or
 
     VarState: TVarState;        // Indicates the state of the variable, if it’s used or
 
                                 // declared
 
                                 // declared
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
 
   
 
   
  
{| border="1" cellpadding="3" cellspacing="0"
+
{| class="wikitable"
! style="background:#f0f0f0;text-align:left;" | TVarOptions
+
! TVarOptions !! Description
! style="background:#f0f0f0;text-align:left;" | Description
 
 
|-
 
|-
 
| vo_regable || The variable can be put into a hardware general purpose register
 
| vo_regable || The variable can be put into a hardware general purpose register
Line 193: Line 209:
  
  
{| border="1" cellpadding="3" cellspacing="0"
+
{| class="wikitable"
! style="background:#f0f0f0;text-align:left;" | TVarSpez
+
! TVarSpez !! Description
! style="background:#f0f0f0;text-align:left;" | Description
 
 
|-
 
|-
 
| vs_value || This is a value parameter
 
| vs_value || This is a value parameter
Line 204: Line 219:
 
|}
 
|}
  
=== property symbol (TPropertySym) ===
+
=== Property symbol (TPropertySym) ===
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PPropertySym = ^TPropertySym;
 
   PPropertySym = ^TPropertySym;
   TPropertySym = <b>object</b>(TSym)
+
   TPropertySym = object(TSym)
 
     PropOptions: TPropertyOptions;    // ???
 
     PropOptions: TPropertyOptions;    // ???
 
     PropType: TType;                  // Indicates the type of the property
 
     PropType: TType;                  // Indicates the type of the property
Line 218: Line 234:
 
     WriteAccess: PSymList;            // ???
 
     WriteAccess: PSymList;            // ???
 
     StoredAccess: PSymList;          // ???
 
     StoredAccess: PSymList;          // ???
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
 +
 
 +
=== Return value of function symbol ===
  
=== return value of function symbol ===
+
...
  
=== absolute declared symbol (TAbsoluteSym) ===
+
=== Absolute declared symbol (TAbsoluteSym) ===
  
 
This symbol represents a variable declared with the <tt>absolute</tt> keyword. The address of the <tt>TVarSym</tt> object holds the address of the variable in the case of an absolute address variable.
 
This symbol represents a variable declared with the <tt>absolute</tt> keyword. The address of the <tt>TVarSym</tt> object holds the address of the variable in the case of an absolute address variable.
Line 229: Line 248:
 
address (for certain targets only), or on top of another declared variable.
 
address (for certain targets only), or on top of another declared variable.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PAbsoluteSym = ^TAbsoluteSym;
 
   PAbsoluteSym = ^TAbsoluteSym;
   TAbsoluteSym = <b>object</b>(TVarSym)
+
   TAbsoluteSym = object(TVarSym)
 
     AbsTyp: TAbsoluteTyp;        // Indicates the type of absolute symbol it is  
 
     AbsTyp: TAbsoluteTyp;        // Indicates the type of absolute symbol it is  
 
     AbsSeg: Boolean;              // ???
 
     AbsSeg: Boolean;              // ???
Line 239: Line 259:
 
     AsmName: PString;            // In case abstyp is toasm, this field indicates label
 
     AsmName: PString;            // In case abstyp is toasm, this field indicates label
 
                                   // name for the variable.
 
                                   // name for the variable.
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
  
{| border="1" cellpadding="3" cellspacing="0"
+
{| class="wikitable"
! style="background:#f0f0f0;text-align:left;" | TAbsoluteTyp
+
! TAbsoluteTyp !! Description
! style="background:#f0f0f0;text-align:left;" | Description
 
 
|-
 
|-
 
| toVar || The symbol will be declared on top of another symbol (variable or typed constant)
 
| toVar || The symbol will be declared on top of another symbol (variable or typed constant)
Line 252: Line 272:
 
|}
 
|}
 
   
 
   
=== typed constant symbol ===
+
=== Typed constant symbol ===
  
=== constant symbol (TConstSym) ===
+
...
 +
 
 +
=== Constant symbol (TConstSym) ===
  
 
This symbol type will contain all constants defined and encountered during the parsing. The
 
This symbol type will contain all constants defined and encountered during the parsing. The
 
values of the constants are also set in this symbol type entry.
 
values of the constants are also set in this symbol type entry.
  
<tt><b>type</b>
+
<syntaxhighlight lang=pascal>
 +
type
 
   PConstSym = ^TConstSym;
 
   PConstSym = ^TConstSym;
   TConstSym = <b>object</b>(TSym)
+
   TConstSym = object(TSym)
 
     ConstType: TType;      // Type information for this constant (?).
 
     ConstType: TType;      // Type information for this constant (?).
 
     ConstTyp: TConstTyp;    // Indicates the type of the constant
 
     ConstTyp: TConstTyp;    // Indicates the type of the constant
Line 268: Line 291:
 
     Value: Longint;        // In certain cases, contains the value of the constant
 
     Value: Longint;        // In certain cases, contains the value of the constant
 
     Len: Longint;
 
     Len: Longint;
   <b>end;</b></tt>
+
   end;
 +
</syntaxhighlight>
 +
 
 +
=== Enumeration symbol ===
  
=== enumeration symbol ===
+
...
  
=== program symbol ===
+
=== Program symbol ===
  
 
The program symbol type (<tt>TProgramSym</tt>) is used to store the name of the program, which is declared using <tt>program</tt> in the pascal source. This symbol type is currently unused in FreePascal.
 
The program symbol type (<tt>TProgramSym</tt>) is used to store the name of the program, which is declared using <tt>program</tt> in the pascal source. This symbol type is currently unused in FreePascal.
  
=== sys symbol ===
+
=== Sys symbol ===
  
 
The <tt>TSysSym</tt> symbol type is used to load indexes into the symbol table of the internal routines which are inlined directly by the compiler. It has a single field, which is the index of the inline routine.
 
The <tt>TSysSym</tt> symbol type is used to load indexes into the symbol table of the internal routines which are inlined directly by the compiler. It has a single field, which is the index of the inline routine.

Latest revision as of 13:37, 25 December 2020

English (en) français (fr)

back to contents FPC internals

Symbol entries

Architecture

Warning-icon.png

Warning: Last updated for FPC version 1.0.x

There are different possible types of symbols, each one having different fields then the others. Each symbol type has a specific signature to indicate what kind of entry it is. Each entry in the symbol table is actually one of the symbol entries described in the following sections. The relationship between a symbol entry, a type definition, and the type name symbol entry is shown in the following figure:

http://www.pjh2.de/fpc/CompilerInternalsFigure06.png

Symbol entry types

Warning-icon.png

Warning: Last updated for FPC version 1.0.x

Base symbol type (TSym)

All entries in the symbol table are derived from this base object which contains information on the symbol type as well as information on the owner of this symbol entry.

type
  PSym = ^TSym;
  TSym = object(TSymTableEntry)
    SymOptions: TSymOptions;  // Indicate the access scope of the symbol
    FileInfo: TFilePosInfo;
    Refs: Longint;            // Indicates how many times this label is refered in the
                              // parsed code (is only used with variable and assembler
                              // label symbols).
    LastRef: PRef;
    DefRef: PRef;
    LastWritten: PRef;
    RefCount: Longint;        // Browser information indicating the reference count
    Typ: TSymTyp;             // Indicates the symbol type
    IsStabWritten: Boolean;   // Set to TRUE if the stabs debugging information has
                              // been written for this symbol.
  end;
TSymTyp Description
AbstractSym This is a special abstract symbol (this should never occur)
VarSym This symbol is a variable declaration in the var section, or a var parameter.
TypeSym This symbol is a type name
ProcSym This symbol is a routine or method name
UnitSym This symbol is a unit name
ProgramSym This symbol is the main program name
ConstSym This symbol is a constant
EnumSym This symbol is an enumeration symbol (an element in an enumeration)
TypedConstSym This symbol is pre-initialized variable (pascal typed constant)
ErrorSym This symbol is created for error generation
SysSym This symbol represents an inlined system unit routine
LabelSym This symbol represents a label in a label pascal declaration
AbsoluteSym This symbol represents an the symbol following an absolute variable declaration
PropertySym This symbol is a property name
FuncRetSym This symbol is the name of the return value for functions
MacroSym This symbol is a macro symbol (just like #define in C)

Label symbol (TLabelSym)

The label symbol table entry is only created when a pascal label is declared via the label keyword. The object has the following fields which are available for use publicly:

type
  PLabelSym = ^TLabelSym;
  TLabelSym = object(TSym)
    Used: Boolean;                 // Set to TRUE if this pascal label is used using a goto
                                   // or in an assembler statement
    Defined: Boolean;              // Set to TRUE if this label has been declared
    Lab: PAsmLabel;                // Points to the actual assembler label structure which
                                   // will be emitted by the code generator
    Code: Pointer;
  end;


Unit symbol (TUnitSym)

The unit symbol is created and added to the symbol table each time that the uses clause is parsed and a unit name is found, it is also used when compiling a unit, with the first entry in that symbol table being the unit name being compiled. The unit symbol entry is actual part of a linked list which is used in the unit symbol table.

type
  PUnitSym = ^TUnitSym;
  TUnitSym = object(TSym)
    UnitSymTable: PUnitSymTable;  // Pointer to the global symbol table for that
                                  // unit, containing entries for each public?
                                  // symbol in that unit
    PrevSym: PUnitSym;            // Pointer to previous entry in the linked list
  end;

Macro symbol (TMacroSym)

The macro synbols are used in the preprocessor for conditional compilation statements. There is one such entry created for each $define directive, it contains the value of the define (stored as a string).

type
  PMacroSym = ^TMacroSym;
  TMacroSym = object(TSym)
    Defined: Boolean;              // TRUE if the symbol has been defined with a 
                                   // $define directive, or false if it has been 
                                   // undefined with a $undef directive
    Defined_At_Startup: Boolean;   // TRUE if the symbol is a system wide define
    Is_Used: Boolean;              // TRUE if the define has been used such as in 
                                   // a $ifdef directive.
    BufText: PChar;                // The actual string text of the define
    BufLength: Longint;            // The actual string length of the define
  end;

Error symbol (TErrorSym)

This symbol is actually an empty symbol table entry. When the parser encounters an error when parsing a symbol, instead of putting nothing in the symbol table, it puts this symbol entry. This avoids illegal memory accesses later in parsing.

Procedure symbol (TProcSym)

The procedure symbol is created each time a routine is defined in the code. This can be either a forward definition or the actual implementation of the routine. After creation, the symbol is added into the appropriate symbol table stack.

type
  PProcSym = ^TProcSym;
  TProcSym = object(TSym)
    Is_Global: Boolean;           // Set if the routine is exported by the unit
    Definition: PProcDef;         // Procedure definition, including parameter 
                                  // information and return values
  end;

Type symbol (TTypeSym)

The type symbol is created each time a new type declaration is done, the current symbol table stack is then inserted with this symbol. Furthermore, each time the compiler compiles a module, the default base types are initialized and added into the symbol table (psystem.pas) The type symbol contains the name of a type, as well as a pointer to its type definition.

type
  PTypeSym = ^TTypeSym;
  TTypeSym = object(TSym)
    ResType: TType;               // Contains base type information as well as the type
                                  // definition
  end;

Variable symbol (TVarSym)

Variable declarations, as well as parameters which are passed onto routines are declared as variable symbol types. Access information, as well as type information and optimization information are stored in this symbol type.

type
  PVarSym = ^TVarSym;
  TVarSym = object(TSym)
    Reg: TRegister;              // If the value is a register variable, the reg field will
                                 // be different then R_NO
    VarSpez: TVarSpez;           // Indicates the variable type (parameters only) (Cf. 32).
    Address: Longint;            // In the case where the variable is a routine parameter,
                                 // this indicates the positive offset from theframe_pointer 
                                 // to access this variable. In the caseof a local variable,
                                 // this field indicates the negative offset from the 
                                 // frame_pointer. to access this variable.
    LocalVarSym: PVarSym;
    VarType: TType;              // Contains base type information as well as the type
                                 // definition
    VarOptions: TVarOptions;     // Flags for this variable (Cf. 31)
    VarState: TVarState;         // Indicates the state of the variable, if it’s used or
                                 // declared
  end;


TVarOptions Description
vo_regable The variable can be put into a hardware general purpose register
vo_is_c_var The variable is imported from a C module
vo_is_external The variable is declared external
vo_is_Dll_var The variable is a shared library variable
vo_is_thread_var The variable is declared as being thread safe
vo_fpuregable The variable can be put into a hardware floating point register
vo_is_local_copy  
vo_is_const unused and useless
vo_is_exported The variable is declared as exported in a dynamic link library


TVarSpez Description
vs_value This is a value parameter
vs_const This is a constant parameter, property or array
vs_var This is a variable parameter

Property symbol (TPropertySym)

type
  PPropertySym = ^TPropertySym;
  TPropertySym = object(TSym)
    PropOptions: TPropertyOptions;    // ???
    PropType: TType;                  // Indicates the type of the property
    PropOverriden: PPropertySym;      // ???
    IndexType: TType;
    Index: Longint;                   // ????
    Default: Longint;                 // ???
    ReadAccess: PSymList;             // ???
    WriteAccess: PSymList;            // ???
    StoredAccess: PSymList;           // ???
  end;

Return value of function symbol

...

Absolute declared symbol (TAbsoluteSym)

This symbol represents a variable declared with the absolute keyword. The address of the TVarSym object holds the address of the variable in the case of an absolute address variable.

The possible types of absolute symbols, are from an external object reference, an absolute address (for certain targets only), or on top of another declared variable.

type
  PAbsoluteSym = ^TAbsoluteSym;
  TAbsoluteSym = object(TVarSym)
    AbsTyp: TAbsoluteTyp;         // Indicates the type of absolute symbol it is 
    AbsSeg: Boolean;              // ???
    Ref: PSym;                    // In case abstyp is tovar, this field indicates the
                                  // symbol which is overlaid with this symbol. Otherwise
                                  // this field is unused.
    AsmName: PString;             // In case abstyp is toasm, this field indicates label
                                  // name for the variable.
  end;
TAbsoluteTyp Description
toVar The symbol will be declared on top of another symbol (variable or typed constant)
toAsm The variable is imported from an external module
toAddr The variable is declared as being at an absolute address

Typed constant symbol

...

Constant symbol (TConstSym)

This symbol type will contain all constants defined and encountered during the parsing. The values of the constants are also set in this symbol type entry.

type
  PConstSym = ^TConstSym;
  TConstSym = object(TSym)
    ConstType: TType;       // Type information for this constant (?).
    ConstTyp: TConstTyp;    // Indicates the type of the constant
    ResStrIndex: Longint;   // If this is a resource string constant, it indicates the
                            // index in the resource table
    Value: Longint;         // In certain cases, contains the value of the constant
    Len: Longint;
  end;

Enumeration symbol

...

Program symbol

The program symbol type (TProgramSym) is used to store the name of the program, which is declared using program in the pascal source. This symbol type is currently unused in FreePascal.

Sys symbol

The TSysSym symbol type is used to load indexes into the symbol table of the internal routines which are inlined directly by the compiler. It has a single field, which is the index of the inline routine.

Symbol interface

Next chapter: Type information