Changeset 105 for branches/interpreter/interpreter4/Source.pas
- Timestamp:
- Feb 17, 2017, 11:19:22 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter/interpreter4/Source.pas
r104 r105 18 18 PEnumerationStates = ^TEnumerationStates; 19 19 PFunction = ^TFunction; 20 PVariables = ^TVariables; 20 21 21 22 TOperator = (opNone, opAdd, opSubtract, opAnd, opOr, opNot, opEqual, opNotEqual); … … 58 59 DataType: PType; 59 60 Index: Integer; 61 RecordVariables: PVariables; 60 62 end; 61 63 … … 63 65 64 66 TVariables = record 67 ParentList: PVariables; 65 68 Items: array of TVariable; 66 69 procedure Add(Variable: TVariable); 67 70 function GetByName(Name: string): PVariable; 68 end;69 PVariables = ^TVariables;71 function GetLast: PVariable; 72 end; 70 73 71 74 TConstant = record … … 173 176 BeginEnd: TBeginEnd; 174 177 Variables: TVariables; 178 Types: TTypes; 179 ParentRecord: PType; 175 180 end; 176 181 … … 210 215 Constants: TConstants; 211 216 UsesSection: TUses; 217 Functions: TFunctions; 212 218 end; 213 219 PUnit = ^TUnit; … … 343 349 while (I < Length(Items)) and (Items[I].Name <> Name) do I := I + 1; 344 350 if I < Length(Items) then Result := @Items[I] 345 else Result := nil; 351 else begin 352 if ParentList <> nil then Result := ParentList^.GetByName(Name) 353 else Result := nil; 354 end; 355 end; 356 357 function TVariables.GetLast: PVariable; 358 begin 359 Result := @Items[Length(Items) - 1]; 346 360 end; 347 361
Note:
See TracChangeset
for help on using the changeset viewer.