Changeset 147 for branches/easy compiler/USourceCode.pas
- Timestamp:
- Jan 17, 2018, 3:34:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/easy compiler/USourceCode.pas
r146 r147 10 10 type 11 11 TSourceCommand = class 12 end; 13 14 TSourceInstructions = class(TObjectList) 12 Parent: TSourceCommand; 13 end; 14 15 TSourceCommands = class(TObjectList) 15 16 end; 16 17 … … 140 141 TCommandBeginEnd = class(TSourceCommand) 141 142 SourceCode: TSourceCode; 142 Instructions: TSourceInstructions;143 Commands: TSourceCommands; 143 144 constructor Create; 144 145 destructor Destroy; override; 145 146 end; 146 147 148 { TCommandIfZero } 149 147 150 TCommandIfZero = class(TSourceCommand) 148 Variable: TSourceVariable; 151 Variable: TSourceReferenceVariable; 152 destructor Destroy; override; 153 end; 154 155 { TCommandRepeat } 156 157 TCommandRepeat = class(TSourceCommand) 158 Command: TSourceCommand; 159 destructor Destroy; override; 160 end; 161 162 TCommandBreak = class(TSourceCommand) 163 end; 164 165 TCommandContinue = class(TSourceCommand) 149 166 end; 150 167 … … 167 184 implementation 168 185 186 { TCommandIfZero } 187 188 destructor TCommandIfZero.Destroy; 189 begin 190 Variable.Free; 191 inherited Destroy; 192 end; 193 194 { TCommandRepeat } 195 196 destructor TCommandRepeat.Destroy; 197 begin 198 Command.Free; 199 inherited Destroy; 200 end; 201 169 202 { TSourceConstant } 170 203 … … 192 225 constructor TCommandBeginEnd.Create; 193 226 begin 194 Instructions := TSourceInstructions.Create;227 Commands := TSourceCommands.Create; 195 228 end; 196 229 197 230 destructor TCommandBeginEnd.Destroy; 198 231 begin 199 Instructions.Free;232 Commands.Free; 200 233 inherited Destroy; 201 234 end; … … 388 421 389 422 Funct := Functions.AddNew('increment'); 423 Funct.AddParameter('Variable', pkVariable); 424 Funct.AddParameter('Addition', pkString); 425 426 Funct := Functions.AddNew('decrement'); 390 427 Funct.AddParameter('Variable', pkVariable); 391 428 Funct.AddParameter('Addition', pkString);
Note:
See TracChangeset
for help on using the changeset viewer.