Changeset 142 for branches/easy compiler/USourceCode.pas
- Timestamp:
- Jan 16, 2018, 3:19:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/easy compiler/USourceCode.pas
r141 r142 116 116 end; 117 117 118 { TSource InstructionFunction}119 120 TSource InstructionFunction= class(TSourceInstruction)118 { TSourceFunctionCall } 119 120 TSourceFunctionCall = class(TSourceInstruction) 121 121 Name: string; 122 122 Parameters: array of TSourceReference; 123 123 procedure AddParameter(Value: TSourceReference); 124 end; 125 126 TSourceCode = class; 127 128 { TSourceBeginEnd } 129 130 TSourceBeginEnd = class(TSourceInstruction) 131 SourceCode: TSourceCode; 132 Instructions: TSourceInstructions; 133 constructor Create; 134 destructor Destroy; override; 124 135 end; 125 136 … … 134 145 Constants: TSourceConstants; 135 146 Functions: TSourceFunctions; 136 Instructions: TSourceInstructions;147 Main: TSourceBeginEnd; 137 148 constructor Create; 138 149 destructor Destroy; override; … … 141 152 142 153 implementation 154 155 { TSourceBeginEnd } 156 157 constructor TSourceBeginEnd.Create; 158 begin 159 Instructions := TSourceInstructions.Create; 160 end; 161 162 destructor TSourceBeginEnd.Destroy; 163 begin 164 Instructions.Free; 165 inherited Destroy; 166 end; 143 167 144 168 { TSourceTypes } … … 290 314 end; 291 315 292 { TSource InstructionFunction}293 294 procedure TSource InstructionFunction.AddParameter(Value: TSourceReference);316 { TSourceFunctionCall } 317 318 procedure TSourceFunctionCall.AddParameter(Value: TSourceReference); 295 319 begin 296 320 SetLength(Parameters, Length(Parameters) + 1); … … 339 363 Constants := TSourceConstants.Create; 340 364 Functions := TSourceFunctions.Create; 341 Instructions := TSourceInstructions.Create; 365 Main := TSourceBeginEnd.Create; 366 Main.SourceCode := Self; 342 367 InitFunctions; 343 368 end; … … 345 370 destructor TSourceCode.Destroy; 346 371 begin 347 Instructions.Free;372 Main.Free; 348 373 Functions.Free; 349 374 Variables.Free;
Note:
See TracChangeset
for help on using the changeset viewer.