home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PP002.ZIP / FOO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-23  |  2KB  |  71 lines

  1. program foo;
  2.  
  3. type
  4.   Value    = Record
  5.                Case Byte of
  6.                  0 : ( Int   : Longint );
  7.                  1 : ( Float : Double  );
  8.                  2 : ( Ch    : Char    );
  9.                  3 : ( Str   : String  );
  10.              End;
  11.  
  12.  
  13.   TForm    = (No_Form,Scalar_Form,Enum_Form,Subrange_Form,
  14.               Array_Form,Record_Form);
  15.  
  16.   TDef     = (No_Def,Constant_Def,Type_Def,Variable_Def,
  17.               Field_Def,ValueParam_Def,VariableParam_Def,
  18.               Program_Def,Procedure_Def,Function_Def);
  19.  
  20.   PDefinition = ^TDefinition;
  21.   PSymbol     = ^TSymbol;
  22.   PType       = ^TType;
  23.  
  24.   TDefinition = Record
  25.                   Key      : TDef; { What type of definition is this? }
  26.                   Case Byte of
  27.                     0 : ( Constant     : Value    );
  28.  
  29.                     1 : ( Param_Count      : Integer;
  30.                           Total_Param_Size : Integer;
  31.                           Total_Local_Size : Integer;
  32.                           Paramaters       : PSymbol;
  33.                           Locals           : PSymbol;
  34.                           Local_Symbols    : PSymbol;
  35.                           Code_Address     : Longint; );
  36.  
  37.                     2 : ( Offset           : Integer;
  38.                           Record_Def       : PSymbol; );
  39.                 End;
  40.  
  41.   TType    = Record
  42.                Size   : Integer;
  43.                Symbol : PSymbol;
  44.  
  45.                Minimum,
  46.                Maximum,
  47.                Count    : Integer;
  48.  
  49.                Case Form:TForm of
  50.                  Enum_Form      : ( Constant_Symbol : PSymbol );
  51.  
  52.                  Subrange_Form  : ( Range_Type      : PType;  );
  53.  
  54.                  Array_Form     : ( Index_Type,
  55.                                     Element_Type    : PType;  );
  56.  
  57.                  Record_Form    : ( Field_Symbol    : PSymbol );
  58.              End;
  59.  
  60.   TSymbol  = Record
  61.                Left,Right     : PSymbol;
  62.                Next           : PSymbol;
  63.                Name           : String;
  64.                Definition     : PDefinition;
  65.                TypeDefinition : PType;
  66.                Level          : Integer;
  67.                Label_Index    : Integer;
  68.              End;
  69.  
  70. begin
  71. end.