Changeset 98 for branches/interpreter/Source3.pas
- Timestamp:
- Feb 3, 2017, 10:48:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter/Source3.pas
r97 r98 6 6 7 7 type 8 TBaseType = (btBoolean, btInteger, btChar, btShortString, btArray); 9 8 10 TType = record 9 11 Name: string; 12 BaseType: TBaseType; 10 13 end; 11 14 PType = ^TType; … … 23 26 Name: string; 24 27 DataType: PType; 28 case Integer of 29 0: (ValueChar: Char); 30 1: (ValueInteger: Integer); 31 2: (ValueString: ShortString); 32 3: (ValueBoolean: Boolean); 25 33 end; 26 34 PVariable = ^TVariable; … … 33 41 function GetByName(Name: string): PVariable; 34 42 end; 43 44 TConstant = record 45 Name: string; 46 DataType: PType; 47 case Integer of 48 0: (ValueChar: Char); 49 1: (ValueInteger: Integer); 50 2: (ValueString: ShortString); 51 3: (ValueBoolean: Boolean); 52 end; 53 PConstant = ^TConstant; 35 54 36 55 TFunctionParameter = record … … 59 78 3: (Assignment: TAssignment); 60 79 4: (Execution: TExecution); 61 end;62 80 } end; 63 81 PCommand = ^TCommand; … … 98 116 ReturnType: PType; 99 117 BeginEnd: TBeginEnd; 118 Variables: TVariables; 100 119 end; 101 120 PFunction = ^TFunction; … … 131 150 function VariableCreate(Name: string; DataType: PType): TVariable; 132 151 function FunctionCreate(Name: string; DataType: PType): TFunction; 133 function TypeCreate(Name: string ): TType;152 function TypeCreate(Name: string; BaseType: TBaseType): TType; 134 153 function FunctionParameterCreate(Name: string; DataType: PType): TFunctionParameter; 135 154 … … 149 168 end; 150 169 151 function TypeCreate(Name: string): TType; 152 begin 153 Result.Name := Name; 170 function TypeCreate(Name: string; BaseType:TBaseType): TType; 171 begin 172 Result.Name := Name; 173 Result.BaseType := BaseType; 154 174 end; 155 175
Note:
See TracChangeset
for help on using the changeset viewer.