Changeset 208 for branches/interpreter2
- Timestamp:
- Apr 22, 2020, 12:02:17 AM (5 years ago)
- Location:
- branches/interpreter2
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/UFormMain.lfm
r207 r208 14 14 OnShow = FormShow 15 15 LCLVersion = '2.0.2.0' 16 object MemoOutput: TMemo17 Left = 71218 Height = 67219 Top = 6420 Width = 67121 Font.Name = 'Liberation Mono'22 ParentFont = False23 ScrollBars = ssAutoBoth24 TabOrder = 025 end26 object Label2: TLabel27 Left = 71428 Height = 2629 Top = 3430 Width = 6631 Caption = 'Output:'32 ParentColor = False33 end34 16 object PanelMessages: TPanel 35 17 Left = 0 … … 39 21 Align = alBottom 40 22 BevelOuter = bvNone 41 TabOrder = 123 TabOrder = 0 42 24 end 43 25 object PanelSource: TPanel … … 47 29 Width = 704 48 30 Align = alCustom 31 BevelOuter = bvNone 32 TabOrder = 1 33 end 34 object PanelOutput: TPanel 35 Left = 751 36 Height = 843 37 Top = 16 38 Width = 655 49 39 BevelOuter = bvNone 50 40 TabOrder = 2 … … 69 59 object MenuItem3: TMenuItem 70 60 Action = AGenerateCSharp 61 end 62 object MenuItem7: TMenuItem 63 Action = AGenerateXml 71 64 end 72 65 end … … 112 105 OnExecute = AOptimizeExecute 113 106 end 107 object AGenerateXml: TAction 108 Caption = 'Generate XML' 109 OnExecute = AGenerateXmlExecute 110 end 114 111 end 115 112 end -
branches/interpreter2/UFormMain.pas
r207 r208 15 15 TFormMain = class(TForm) 16 16 ACompile: TAction; 17 AGenerateXml: TAction; 17 18 AOptimize: TAction; 18 19 AExit: TAction; … … 22 23 AGeneratePascal: TAction; 23 24 ActionList1: TActionList; 24 Label2: TLabel;25 25 MainMenu1: TMainMenu; 26 MemoOutput: TMemo;27 26 MenuItem1: TMenuItem; 28 27 MenuItem2: TMenuItem; … … 31 30 MenuItem5: TMenuItem; 32 31 MenuItem6: TMenuItem; 32 MenuItem7: TMenuItem; 33 33 MenuItemRun: TMenuItem; 34 34 MenuItemGenerate: TMenuItem; 35 35 MenuItemFile: TMenuItem; 36 PanelOutput: TPanel; 36 37 PanelSource: TPanel; 37 38 PanelMessages: TPanel; … … 41 42 procedure AGeneratePascalExecute(Sender: TObject); 42 43 procedure AGeneratePhpExecute(Sender: TObject); 44 procedure AGenerateXmlExecute(Sender: TObject); 43 45 procedure AOptimizeExecute(Sender: TObject); 44 46 procedure ARunExecute(Sender: TObject); … … 68 70 uses 69 71 UParser, UExecutor, UGeneratorPascal, UGeneratorPhp, UFormMessages, UFormSource, 70 UGeneratorCSharp, UOptimizer ;72 UGeneratorCSharp, UOptimizer, UGeneratorXml, UFormOutput; 71 73 72 74 { TFormMain } … … 95 97 DockForm(FormMessages, PanelMessages); 96 98 DockForm(FormSource, PanelSource); 99 DockForm(FormOutput, PanelOutput); 97 100 UpdateInterface; 98 101 end; … … 124 127 ACompile.Execute; 125 128 AOptimize.Execute; 126 MemoOutput.Lines.Clear; 129 FormOutput.SynEditOutput.Highlighter := FormOutput.SynCppSyn1; 130 FormOutput.Clear; 127 131 if Assigned(Prog) then begin 128 132 Generator := TGeneratorCSharp.Create; 129 133 Generator.Prog := Prog; 130 134 Generator.Generate; 131 MemoOutput.Lines.Text := Generator.Output;132 Generator.Free; 133 MemoOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.cs');135 FormOutput.SetText(Generator.Output); 136 Generator.Free; 137 FormOutput.SynEditOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.cs'); 134 138 end; 135 139 end; … … 141 145 ACompile.Execute; 142 146 AOptimize.Execute; 143 MemoOutput.Lines.Clear; 147 FormOutput.SynEditOutput.Highlighter := FormOutput.SynPasSyn1; 148 FormOutput.SynEditOutput.Lines.Clear; 144 149 if Assigned(Prog) then begin 145 150 Generator := TGeneratorPascal.Create; 146 151 Generator.Prog := Prog; 147 152 Generator.Generate; 148 MemoOutput.Lines.Text := Generator.Output;149 Generator.Free; 150 MemoOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.pas');153 FormOutput.SynEditOutput.Lines.Text := Generator.Output; 154 Generator.Free; 155 FormOutput.SynEditOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.pas'); 151 156 end; 152 157 end; … … 157 162 begin 158 163 ACompile.Execute; 159 MemoOutput.Lines.Clear; 164 FormOutput.SynEditOutput.Highlighter := FormOutput.SynPhpSyn1; 165 FormOutput.SynEditOutput.Lines.Clear; 160 166 if Assigned(Prog) then begin 161 167 Generator := TGeneratorPhp.Create; 162 168 Generator.Prog := Prog; 163 169 Generator.Generate; 164 MemoOutput.Lines.Text := Generator.Output; 165 Generator.Free; 166 MemoOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.php'); 170 FormOutput.SynEditOutput.Lines.Text := Generator.Output; 171 Generator.Free; 172 FormOutput.SynEditOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.php'); 173 end; 174 end; 175 176 procedure TFormMain.AGenerateXmlExecute(Sender: TObject); 177 var 178 Generator: TGeneratorXml; 179 begin 180 ACompile.Execute; 181 FormOutput.SynEditOutput.Highlighter := FormOutput.SynXmlSyn1; 182 FormOutput.SynEditOutput.Lines.Clear; 183 if Assigned(Prog) then begin 184 Generator := TGeneratorXml.Create; 185 Generator.Prog := Prog; 186 Generator.Generate; 187 FormOutput.SynEditOutput.Lines.Text := Generator.Output; 188 Generator.Free; 189 FormOutput.SynEditOutput.Lines.SaveToFile('Generated' + DirectorySeparator + 'Test.xml'); 167 190 end; 168 191 end; … … 186 209 ACompile.Execute; 187 210 //AOptimize.Execute; 188 MemoOutput.Lines.Clear; 211 FormOutput.SynEditOutput.Highlighter := nil; 212 FormOutput.SynEditOutput.Lines.Clear; 189 213 if Assigned(Prog) then begin 190 214 Executor := TExecutor.Create; … … 214 238 procedure TFormMain.ExecutorOutput(Text: string); 215 239 begin 216 MemoOutput.Text := MemoOutput.Text + Text;240 FormOutput.SynEditOutput.Text := FormOutput.SynEditOutput.Text + Text; 217 241 end; 218 242 -
branches/interpreter2/UGenerator.pas
r206 r208 9 9 10 10 type 11 12 { TGenerator } 13 11 14 TGenerator = class 12 15 private … … 17 20 procedure AddText(Text: string); 18 21 procedure AddTextLine(Text: string = ''); 22 procedure Generate; virtual; 19 23 property Indent: Integer read FIndent write SetIndent; 20 24 end; … … 51 55 end; 52 56 57 procedure TGenerator.Generate; 58 begin 59 end; 60 53 61 end. 54 62 -
branches/interpreter2/UGeneratorCSharp.pas
r207 r208 36 36 public 37 37 Prog: TProgram; 38 procedure Generate; 38 procedure Generate; override; 39 39 end; 40 40 -
branches/interpreter2/UGeneratorPascal.pas
r207 r208 34 34 public 35 35 Prog: TProgram; 36 procedure Generate; 36 procedure Generate; override; 37 37 end; 38 38 -
branches/interpreter2/UGeneratorPhp.pas
r207 r208 34 34 public 35 35 Prog: TProgram; 36 procedure Generate; 36 procedure Generate; override; 37 37 end; 38 38 -
branches/interpreter2/UOptimizer.pas
r207 r208 46 46 WhileDo: TWhileDo; 47 47 Condition: TIfThenElse; 48 Field: TField; 49 Obj: TObject; 48 50 begin 49 51 NewNode := nil; … … 73 75 end else 74 76 if SourceNode is TSourceNode then begin 75 for I := 0 to SourceNode.NodesCount - 1 do begin 76 OptimizeNode(TSourceNode(SourceNode.Nodes[I]), NewNode); 77 if Assigned(NewNode) and (NewNode <> TSourceNode(SourceNode.Nodes[I])) then begin 78 SourceNode.Nodes[I] := NewNode; 77 for I := 0 to SourceNode.FieldsCount - 1 do begin 78 Field := SourceNode.GetField(I); 79 if Field.DataType = dtObject then begin 80 SourceNode.GetValue(I, Obj); 81 if Obj is TSourceNode then begin 82 OptimizeNode(TSourceNode(Obj), NewNode); 83 if Assigned(NewNode) and (NewNode <> TSourceNode(Obj)) then begin 84 SourceNode.SetValueObject(I, NewNode); 85 end; 86 end; 79 87 end; 88 Field.Free; 80 89 end; 81 90 end else -
branches/interpreter2/USource.pas
r207 r208 13 13 TBeginEnd = class; 14 14 15 TDataType = (dtNone, dtString, dtBoolean, dtInteger, dtFloat, dtColor, 16 dtTime, dtDate, dtDateTime, dtEnumeration, dtObject); 17 18 { TField } 19 20 TField = class 21 Index: Integer; 22 DataType: TDataType; 23 Name: string; 24 constructor Create(ADataType: TDataType; AName: string); 25 end; 26 27 TFields = class(TObjectList) 28 end; 29 15 30 { TSourceNode } 16 31 17 32 TSourceNode = class 18 33 private 19 function GetNode(Index: Integer): TSourceNode; virtual; 20 function GetNodesCount: Integer; virtual; 21 procedure SetNode(Index: Integer; AValue: TSourceNode); virtual; 22 public 23 property NodesCount: Integer read GetNodesCount; 24 property Nodes[Index: Integer]: TSourceNode read GetNode write SetNode; 34 function GetFieldsCount: Integer; virtual; 35 public 36 function GetField(Index: Integer): TField; virtual; 37 procedure GetValue(Index: Integer; out Value); virtual; 38 function GetValueInteger(Index: Integer): Integer; 39 function GetValueString(Index: Integer): string; 40 function GetValueBoolean(Index: Integer): Boolean; 41 function GetValueObject(Index: Integer): TObject; 42 function GetValueAsText(Index: Integer): string; 43 procedure SetValue(Index: Integer; var Value); virtual; 44 procedure SetValueInteger(Index: Integer; Value: Integer); 45 procedure SetValueString(Index: Integer; Value: string); 46 procedure SetValueBoolean(Index: Integer; Value: Boolean); 47 procedure SetValueObject(Index: Integer; Value: TObject); 48 function GetFields: TFields; 49 property FieldsCount: Integer read GetFieldsCount; 25 50 end; 26 51 … … 74 99 75 100 TType = class(TSourceNode) 101 private 102 function GetFieldsCount: Integer; override; 103 public 76 104 Name: string; 77 105 Functions: TFunctions; 78 106 ValueClass: TValueClass; 107 procedure GetValue(Index: Integer; out Value); override; 108 function GetField(Index: Integer): TField; override; 109 procedure SetValue(Index: Integer; var Value); override; 79 110 constructor Create; 80 111 destructor Destroy; override; … … 92 123 TVariable = class(TSourceNode) 93 124 private 94 function GetNode(Index: Integer): TSourceNode; override; 95 function GetNodesCount: Integer; override; 96 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 125 function GetFieldsCount: Integer; override; 97 126 public 98 127 Name: string; 99 128 TypeRef: TType; 129 procedure GetValue(Index: Integer; out Value); override; 130 function GetField(Index: Integer): TField; override; 131 procedure SetValue(Index: Integer; var Value); override; 100 132 end; 101 133 … … 110 142 TConstant = class(TSourceNode) 111 143 private 112 function GetNode(Index: Integer): TSourceNode; override; 113 function GetNodesCount: Integer; override; 114 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 144 function GetFieldsCount: Integer; override; 115 145 public 116 146 Name: string; 117 147 TypeRef: TType; 118 148 Value: TValue; 149 procedure GetValue(Index: Integer; out Value); override; 150 function GetField(Index: Integer): TField; override; 151 procedure SetValue(Index: Integer; var Value); override; 119 152 end; 120 153 … … 142 175 TFunction = class(TSourceNode) 143 176 private 144 function GetNode(Index: Integer): TSourceNode; override; 145 function GetNodesCount: Integer; override; 146 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 177 function GetFieldsCount: Integer; override; 147 178 public 148 179 Name: string; … … 151 182 ResultType: TType; 152 183 BeginEnd: TBeginEnd; 184 procedure GetValue(Index: Integer; out Value); override; 185 function GetField(Index: Integer): TField; override; 186 procedure SetValue(Index: Integer; var Value); override; 153 187 constructor Create; 154 188 destructor Destroy; override; … … 175 209 TFunctionCall = class(TCommand) 176 210 private 177 function GetNode(Index: Integer): TSourceNode; override; 178 function GetNodesCount: Integer; override; 179 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 211 function GetFieldsCount: Integer; override; 180 212 public 181 213 FunctionDef: TFunction; 182 214 Params: TExpressions; 215 procedure GetValue(Index: Integer; out Value); override; 216 function GetField(Index: Integer): TField; override; 217 procedure SetValue(Index: Integer; var Value); override; 183 218 constructor Create; 184 219 destructor Destroy; override; … … 189 224 TBeginEnd = class(TCommand) 190 225 private 191 function GetNode(Index: Integer): TSourceNode; override; 192 function GetNodesCount: Integer; override; 193 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 226 function GetFieldsCount: Integer; override; 194 227 public 195 228 Commands: TCommands; 229 procedure GetValue(Index: Integer; out Value); override; 230 function GetField(Index: Integer): TField; override; 231 procedure SetValue(Index: Integer; var Value); override; 196 232 procedure Clear; 197 233 constructor Create; … … 212 248 TExpressionOperation = class(TExpression) 213 249 private 214 function GetNode(Index: Integer): TSourceNode; override; 215 function GetNodesCount: Integer; override; 216 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 250 function GetFieldsCount: Integer; override; 217 251 public 218 252 TypeRef: TType; 219 253 Operation: TExpressionOperator; 220 254 Items: TExpressions; 255 procedure GetValue(Index: Integer; out Value); override; 256 function GetField(Index: Integer): TField; override; 257 procedure SetValue(Index: Integer; var Value); override; 221 258 constructor Create; 222 259 destructor Destroy; override; … … 230 267 TExpressionOperand = class(TExpression) 231 268 private 232 function GetNode(Index: Integer): TSourceNode; override; 233 function GetNodesCount: Integer; override; 234 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 269 function GetFieldsCount: Integer; override; 235 270 public 236 271 OperandType: TExpressionOperandType; … … 239 274 ConstantDirect: TConstant; 240 275 FunctionCall: TFunctionCall; 276 procedure GetValue(Index: Integer; out Value); override; 277 function GetField(Index: Integer): TField; override; 278 procedure SetValue(Index: Integer; var Value); override; 241 279 function GetType: TType; override; 242 280 constructor Create; … … 251 289 TAssignment = class(TCommand) 252 290 private 253 function GetNode(Index: Integer): TSourceNode; override; 254 function GetNodesCount: Integer; override; 255 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 291 function GetFieldsCount: Integer; override; 256 292 public 257 293 Variable: TVariable; 258 294 Expression: TExpression; 295 procedure GetValue(Index: Integer; out Value); override; 296 function GetField(Index: Integer): TField; override; 297 procedure SetValue(Index: Integer; var Value); override; 259 298 constructor Create; 260 299 destructor Destroy; override; … … 265 304 TIfThenElse = class(TCommand) 266 305 private 267 function GetNode(Index: Integer): TSourceNode; override; 268 function GetNodesCount: Integer; override; 269 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 306 function GetFieldsCount: Integer; override; 270 307 public 271 308 Expression: TExpression; 272 309 CommandThen: TCommand; 273 310 CommandElse: TCommand; 311 procedure GetValue(Index: Integer; out Value); override; 312 function GetField(Index: Integer): TField; override; 313 procedure SetValue(Index: Integer; var Value); override; 274 314 constructor Create; 275 315 destructor Destroy; override; … … 280 320 TWhileDo = class(TCommand) 281 321 private 282 function GetNode(Index: Integer): TSourceNode; override; 283 function GetNodesCount: Integer; override; 284 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 322 function GetFieldsCount: Integer; override; 285 323 public 286 324 Expression: TExpression; 287 325 Command: TCommand; 326 procedure GetValue(Index: Integer; out Value); override; 327 function GetField(Index: Integer): TField; override; 328 procedure SetValue(Index: Integer; var Value); override; 288 329 constructor Create; 289 330 destructor Destroy; override; … … 294 335 TRepeatUntil = class(TCommand) 295 336 private 296 function GetNode(Index: Integer): TSourceNode; override; 297 function GetNodesCount: Integer; override; 298 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 337 function GetFieldsCount: Integer; override; 299 338 public 300 339 Expression: TExpression; 301 340 Commands: TCommands; 341 procedure GetValue(Index: Integer; out Value); override; 342 function GetField(Index: Integer): TField; override; 343 procedure SetValue(Index: Integer; var Value); override; 302 344 constructor Create; 303 345 destructor Destroy; override; … … 314 356 TForToDo = class(TCommand) 315 357 private 316 function GetNode(Index: Integer): TSourceNode; override; 317 function GetNodesCount: Integer; override; 318 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 358 function GetFieldsCount: Integer; override; 319 359 public 320 360 VariableRef: TVariable; … … 322 362 ExpressionTo: TExpression; 323 363 Command: TCommand; 364 procedure GetValue(Index: Integer; out Value); override; 365 function GetField(Index: Integer): TField; override; 366 procedure SetValue(Index: Integer; var Value); override; 324 367 constructor Create; 325 368 destructor Destroy; override; … … 330 373 TBlock = class(TSourceNode) 331 374 private 332 function GetNode(Index: Integer): TSourceNode; override; 333 function GetNodesCount: Integer; override; 334 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 375 function GetFieldsCount: Integer; override; 335 376 public 336 377 Parent: TBlock; … … 340 381 Types: TTypes; 341 382 BeginEnd: TBeginEnd; 383 procedure GetValue(Index: Integer; out Value); override; 384 function GetField(Index: Integer): TField; override; 385 procedure SetValue(Index: Integer; var Value); override; 342 386 procedure Clear; 343 387 function GetType(Name: string): TType; … … 353 397 TProgram = class(TSourceNode) 354 398 private 355 function GetNode(Index: Integer): TSourceNode; override; 356 function GetNodesCount: Integer; override; 357 procedure SetNode(Index: Integer; AValue: TSourceNode); override; 399 function GetFieldsCount: Integer; override; 358 400 public 359 401 Name: string; 360 402 SystemBlock: TBlock; 361 403 Block: TBlock; 404 procedure GetValue(Index: Integer; out Value); override; 405 function GetField(Index: Integer): TField; override; 406 procedure SetValue(Index: Integer; var Value); override; 362 407 procedure Clear; 363 408 constructor Create; … … 365 410 end; 366 411 412 const 413 DataTypeStr: array[TDataType] of string = ('None', 'String', 'Boolean', 414 'Integer', 'Float', 'Color', 'Time', 'Date', 'DateTime', 'Enumeration', 415 'Reference'); 416 367 417 368 418 implementation … … 370 420 resourcestring 371 421 SIndexError = 'Index error'; 422 SUnsupportedValueIndex = 'Unsupported value index %d'; 423 SUnsupportedDataType = 'Unsupported field value data type %s'; 424 SYes = 'Yes'; 425 SNo = 'No'; 426 427 { TField } 428 429 constructor TField.Create(ADataType: TDataType; AName: string); 430 begin 431 DataType := ADataType; 432 Name := AName; 433 end; 372 434 373 435 { TSourceNodes } … … 411 473 { TVariable } 412 474 413 function TVariable.GetNode(Index: Integer): TSourceNode; 414 begin 415 if Index = 0 then Result := TypeRef 416 else raise Exception.Create(SIndexError); 417 end; 418 419 function TVariable.GetNodesCount: Integer; 420 begin 421 Result := 1; 422 end; 423 424 procedure TVariable.SetNode(Index: Integer; AValue: TSourceNode); 425 begin 426 if Index = 0 then TypeRef := TType(AValue) 427 else raise Exception.Create(SIndexError); 475 procedure TVariable.GetValue(Index: Integer; out Value); 476 begin 477 if Index = 0 then string(Value) := Name 478 else if Index = 1 then TType(Value) := TypeRef 479 else inherited; 480 end; 481 482 function TVariable.GetField(Index: Integer): TField; 483 begin 484 if Index = 0 then Result := TField.Create(dtString, 'Name') 485 else if Index = 1 then Result := TField.Create(dtObject, 'Type') 486 else inherited; 487 end; 488 489 function TVariable.GetFieldsCount: Integer; 490 begin 491 Result := 2; 492 end; 493 494 procedure TVariable.SetValue(Index: Integer; var Value); 495 begin 496 if Index = 0 then Name := string(Value) 497 else if Index = 1 then TypeRef := TType(Value) 498 else inherited; 428 499 end; 429 500 430 501 { TConstant } 431 502 432 function TConstant.GetNode(Index: Integer): TSourceNode; 433 begin 434 if Index = 0 then Result := TypeRef 435 else raise Exception.Create(SIndexError); 436 end; 437 438 function TConstant.GetNodesCount: Integer; 439 begin 440 Result := 1; 441 end; 442 443 procedure TConstant.SetNode(Index: Integer; AValue: TSourceNode); 444 begin 445 if Index = 0 then TypeRef := TType(AValue) 446 else raise Exception.Create(SIndexError); 503 procedure TConstant.GetValue(Index: Integer; out Value); 504 begin 505 if Index = 0 then string(Value) := Name 506 else if Index = 1 then TType(Value) := TypeRef 507 else inherited; 508 end; 509 510 function TConstant.GetField(Index: Integer): TField; 511 begin 512 if Index = 0 then Result := TField.Create(dtString, 'Name') 513 else if Index = 1 then Result := TField.Create(dtObject, 'Type') 514 else inherited; 515 end; 516 517 function TConstant.GetFieldsCount: Integer; 518 begin 519 Result := 2; 520 end; 521 522 procedure TConstant.SetValue(Index: Integer; var Value); 523 begin 524 if Index = 0 then Name := string(Value) 525 else if Index = 1 then TypeRef := TType(Value) 526 else inherited; 447 527 end; 448 528 449 529 { TSourceNode } 450 530 451 function TSourceNode.GetNode(Index: Integer): TSourceNode;452 begin 453 raise Exception.Create( SIndexError);454 end; 455 456 function TSourceNode.Get NodesCount: Integer;531 procedure TSourceNode.GetValue(Index: Integer; out Value); 532 begin 533 raise Exception.Create(Format(SUnsupportedValueIndex, [Index])); 534 end; 535 536 function TSourceNode.GetFieldsCount: Integer; 457 537 begin 458 538 Result := 0; 459 539 end; 460 540 461 procedure TSourceNode.SetNode(Index: Integer; AValue: TSourceNode); 462 begin 463 raise Exception.Create(SIndexError); 541 function TSourceNode.GetField(Index: Integer): TField; 542 begin 543 Result := nil; 544 raise Exception.Create(Format(SUnsupportedValueIndex, [Index])); 545 end; 546 547 procedure TSourceNode.SetValue(Index: Integer; var Value); 548 begin 549 raise Exception.Create(Format(SUnsupportedValueIndex, [Index])); 550 end; 551 552 function TSourceNode.GetValueInteger(Index: Integer): Integer; 553 begin 554 GetValue(Index, Result); 555 end; 556 557 function TSourceNode.GetValueString(Index: Integer): string; 558 begin 559 GetValue(Index, Result); 560 end; 561 562 function TSourceNode.GetValueBoolean(Index: Integer): Boolean; 563 begin 564 GetValue(Index, Result); 565 end; 566 567 function TSourceNode.GetValueObject(Index: Integer): TObject; 568 begin 569 GetValue(Index, Result); 570 end; 571 572 function TSourceNode.GetValueAsText(Index: Integer): string; 573 var 574 Field: TField; 575 Item: TObject; 576 begin 577 Field := GetField(Index); 578 try 579 if Field.DataType = dtInteger then Result := IntToStr(GetValueInteger(Index)) 580 else if Field.DataType = dtString then Result := GetValueString(Index) 581 //else if Field.DataType = dtEnumeration then Result := Field.EnumStates[Integer(GetValueEnumeration(Index))] 582 else if Field.DataType = dtObject then begin 583 Item := TObject(GetValueObject(Index)); 584 if Assigned(Item) then Result := Item.ClassName 585 else Result := ''; 586 end else if Field.DataType = dtBoolean then begin 587 if GetValueBoolean(Index) then Result := SYes else Result := SNo; 588 end else 589 raise Exception.Create(Format(SUnsupportedDataType, [DataTypeStr[Field.DataType]])); 590 finally 591 Field.Free; 592 end; 593 end; 594 595 596 procedure TSourceNode.SetValueInteger(Index: Integer; Value: Integer); 597 begin 598 SetValue(Index, Value); 599 end; 600 601 procedure TSourceNode.SetValueString(Index: Integer; Value: string); 602 begin 603 SetValue(Index, Value); 604 end; 605 606 procedure TSourceNode.SetValueBoolean(Index: Integer; Value: Boolean); 607 begin 608 SetValue(Index, Value); 609 end; 610 611 procedure TSourceNode.SetValueObject(Index: Integer; Value: TObject); 612 begin 613 SetValue(Index, Value); 614 end; 615 616 function TSourceNode.GetFields: TFields; 617 var 618 I: Integer; 619 begin 620 Result := TFields.Create; 621 for I := 0 to GetFieldsCount - 1 do 622 Result.Add(GetField(I)); 464 623 end; 465 624 466 625 { TRepeatUntil } 467 626 468 function TRepeatUntil.GetNode(Index: Integer): TSourceNode; 469 begin 470 if Index = 0 then Result := Expression 471 else if Index = 1 then Result := Commands 472 else raise Exception.Create(SIndexError); 473 end; 474 475 function TRepeatUntil.GetNodesCount: Integer; 627 procedure TRepeatUntil.GetValue(Index: Integer; out Value); 628 begin 629 if Index = 0 then TExpression(Value) := Expression 630 else if Index = 1 then TCommands(Value) := Commands 631 else inherited; 632 end; 633 634 function TRepeatUntil.GetField(Index: Integer): TField; 635 begin 636 if Index = 0 then Result := TField.Create(dtObject, 'Expression') 637 else if Index = 1 then Result := TField.Create(dtObject, 'Commands') 638 else inherited; 639 end; 640 641 function TRepeatUntil.GetFieldsCount: Integer; 476 642 begin 477 643 Result := 2; 478 644 end; 479 645 480 procedure TRepeatUntil.Set Node(Index: Integer; AValue: TSourceNode);481 begin 482 if Index = 0 then Expression := TExpression( AValue)483 else if Index = 1 then Commands := TCommands( AValue)484 else raise Exception.Create(SIndexError);646 procedure TRepeatUntil.SetValue(Index: Integer; var Value); 647 begin 648 if Index = 0 then Expression := TExpression(Value) 649 else if Index = 1 then Commands := TCommands(Value) 650 else inherited; 485 651 end; 486 652 … … 531 697 { TForToDo } 532 698 533 function TForToDo.GetNode(Index: Integer): TSourceNode; 534 begin 535 if Index = 0 then Result := VariableRef 536 else if Index = 1 then Result := ExpressionFrom 537 else if Index = 2 then Result := ExpressionTo 538 else if Index = 3 then Result := Command 539 else raise Exception.Create(SIndexError); 540 end; 541 542 function TForToDo.GetNodesCount: Integer; 699 procedure TForToDo.GetValue(Index: Integer; out Value); 700 begin 701 if Index = 0 then TVariable(Value) := VariableRef 702 else if Index = 1 then TExpression(Value) := ExpressionFrom 703 else if Index = 2 then TExpression(Value) := ExpressionTo 704 else if Index = 3 then TCommand(Value) := Command 705 else inherited; 706 end; 707 708 function TForToDo.GetField(Index: Integer): TField; 709 begin 710 if Index = 0 then Result := TField.Create(dtObject, 'Variable') 711 else if Index = 1 then Result := TField.Create(dtObject, 'To') 712 else if Index = 2 then Result := TField.Create(dtObject, 'From') 713 else if Index = 3 then Result := TField.Create(dtObject, 'Do') 714 else inherited; 715 end; 716 717 function TForToDo.GetFieldsCount: Integer; 543 718 begin 544 719 Result := 4; 545 720 end; 546 721 547 procedure TForToDo.Set Node(Index: Integer; AValue: TSourceNode);548 begin 549 if Index = 0 then VariableRef := TVariable( AValue)550 else if Index = 1 then ExpressionFrom := TExpression( AValue)551 else if Index = 2 then ExpressionTo := TExpression( AValue)552 else if Index = 3 then Command := TCommand( AValue)553 else raise Exception.Create(SIndexError);722 procedure TForToDo.SetValue(Index: Integer; var Value); 723 begin 724 if Index = 0 then VariableRef := TVariable(Value) 725 else if Index = 1 then ExpressionFrom := TExpression(Value) 726 else if Index = 2 then ExpressionTo := TExpression(Value) 727 else if Index = 3 then Command := TCommand(Value) 728 else inherited; 554 729 end; 555 730 … … 578 753 { TExpressionOperand } 579 754 580 function TExpressionOperand.GetNode(Index: Integer): TSourceNode;755 procedure TExpressionOperand.GetValue(Index: Integer; out Value); 581 756 begin 582 757 if Index = 0 then begin 583 758 case OperandType of 584 otConstantDirect: Result:= ConstantDirect;585 otConstantRef: Result:= ConstantRef;586 otFunctionCall: Result:= FunctionCall;587 otVariableRef: Result:= VariableRef;759 otConstantDirect: TConstant(Value) := ConstantDirect; 760 otConstantRef: TConstant(Value) := ConstantRef; 761 otFunctionCall: TFunctionCall(Value) := FunctionCall; 762 otVariableRef: TVariable(Value) := VariableRef; 588 763 end; 589 764 end 590 else raise Exception.Create(SIndexError); 591 end; 592 593 function TExpressionOperand.GetNodesCount: Integer; 765 else inherited; 766 end; 767 768 function TExpressionOperand.GetField(Index: Integer): TField; 769 begin 770 if Index = 0 then Result := TField.Create(dtObject, 'Value') 771 else inherited; 772 end; 773 774 function TExpressionOperand.GetFieldsCount: Integer; 594 775 begin 595 776 Result := 1; 596 777 end; 597 778 598 procedure TExpressionOperand.Set Node(Index: Integer; AValue: TSourceNode);779 procedure TExpressionOperand.SetValue(Index: Integer; var Value); 599 780 begin 600 781 if Index = 0 then begin 601 782 case OperandType of 602 otConstantDirect: ConstantDirect := TConstant( AValue);603 otConstantRef: ConstantRef := TConstant( AValue);604 otFunctionCall: FunctionCall := TFunctionCall( AValue);605 otVariableRef: VariableRef := TVariable( AValue);783 otConstantDirect: ConstantDirect := TConstant(Value); 784 otConstantRef: ConstantRef := TConstant(Value); 785 otFunctionCall: FunctionCall := TFunctionCall(Value); 786 otVariableRef: VariableRef := TVariable(Value); 606 787 end; 607 788 end 608 else raise Exception.Create(SIndexError);789 else inherited; 609 790 end; 610 791 … … 649 830 { TFunction } 650 831 651 function TFunction.GetNode(Index: Integer): TSourceNode; 652 begin 653 if Index = 0 then Result := BeginEnd 654 else if Index = 1 then Result := Params 655 else if Index = 2 then Result := ResultType 656 else raise Exception.Create(SIndexError); 657 end; 658 659 function TFunction.GetNodesCount: Integer; 660 begin 661 Result := 3; 662 end; 663 664 procedure TFunction.SetNode(Index: Integer; AValue: TSourceNode); 665 begin 666 if Index = 0 then BeginEnd := TBeginEnd(AValue) 667 else if Index = 1 then Params := TFunctionParameters(AValue) 668 else if Index = 2 then ResultType := TType(AValue) 669 else raise Exception.Create(SIndexError); 832 procedure TFunction.GetValue(Index: Integer; out Value); 833 begin 834 if Index = 0 then TBeginEnd(Value) := BeginEnd 835 else if Index = 1 then TFunctionParameters(Value) := Params 836 else if Index = 2 then TType(Value) := ResultType 837 else if Index = 3 then string(Value) := Name 838 else inherited; 839 end; 840 841 function TFunction.GetField(Index: Integer): TField; 842 begin 843 if Index = 0 then Result := TField.Create(dtObject, 'Block') 844 else if Index = 1 then Result := TField.Create(dtObject, 'Parameters') 845 else if Index = 2 then Result := TField.Create(dtObject, 'ResultType') 846 else if Index = 3 then Result := TField.Create(dtString, 'Name') 847 else inherited; 848 end; 849 850 function TFunction.GetFieldsCount: Integer; 851 begin 852 Result := 4; 853 end; 854 855 procedure TFunction.SetValue(Index: Integer; var Value); 856 begin 857 if Index = 0 then BeginEnd := TBeginEnd(Value) 858 else if Index = 1 then Params := TFunctionParameters(Value) 859 else if Index = 2 then ResultType := TType(Value) 860 else if Index = 3 then Name := string(Value) 861 else inherited; 670 862 end; 671 863 … … 684 876 685 877 { TType } 878 879 procedure TType.GetValue(Index: Integer; out Value); 880 begin 881 if Index = 0 then string(Value) := Name 882 else inherited; 883 end; 884 885 function TType.GetField(Index: Integer): TField; 886 begin 887 if Index = 0 then Result := TField.Create(dtString, 'Name') 888 else inherited; 889 end; 890 891 function TType.GetFieldsCount: Integer; 892 begin 893 Result := 1; 894 end; 895 896 procedure TType.SetValue(Index: Integer; var Value); 897 begin 898 if Index = 0 then Name := string(Value) 899 else inherited; 900 end; 686 901 687 902 constructor TType.Create; … … 717 932 { TExpressionOperation } 718 933 719 function TExpressionOperation.GetNode(Index: Integer): TSourceNode; 720 begin 721 Result := TSourceNode(Items[Index]); 722 end; 723 724 function TExpressionOperation.GetNodesCount: Integer; 934 procedure TExpressionOperation.GetValue(Index: Integer; out Value); 935 begin 936 TObject(Value) := Items[Index]; 937 end; 938 939 function TExpressionOperation.GetField(Index: Integer): TField; 940 begin 941 if Index < Items.Count then Result := TField.Create(dtObject, 'Expression') 942 else inherited; 943 end; 944 945 function TExpressionOperation.GetFieldsCount: Integer; 725 946 begin 726 947 Result := Items.Count; 727 948 end; 728 949 729 procedure TExpressionOperation.Set Node(Index: Integer; AValue: TSourceNode);730 begin 731 Items[Index] := AValue;950 procedure TExpressionOperation.SetValue(Index: Integer; var Value); 951 begin 952 Items[Index] := TObject(Value); 732 953 end; 733 954 … … 750 971 { TAssignment } 751 972 752 function TAssignment.GetNode(Index: Integer): TSourceNode; 753 begin 754 if Index = 0 then Result := Expression 755 else if Index = 1 then Result := Variable 756 else raise Exception.Create(SIndexError); 757 end; 758 759 function TAssignment.GetNodesCount: Integer; 973 procedure TAssignment.GetValue(Index: Integer; out Value); 974 begin 975 if Index = 0 then TExpression(Value) := Expression 976 else if Index = 1 then TVariable(Value) := Variable 977 else inherited; 978 end; 979 980 function TAssignment.GetField(Index: Integer): TField; 981 begin 982 if Index = 0 then Result := TField.Create(dtObject, 'Expression') 983 else if Index = 1 then Result := TField.Create(dtObject, 'Variable') 984 else inherited; 985 end; 986 987 function TAssignment.GetFieldsCount: Integer; 760 988 begin 761 989 Result := 2; 762 990 end; 763 991 764 procedure TAssignment.Set Node(Index: Integer; AValue: TSourceNode);765 begin 766 if Index = 0 then Expression := TExpression( AValue)767 else if Index = 1 then Variable := TVariable( AValue)768 else raise Exception.Create(SIndexError);992 procedure TAssignment.SetValue(Index: Integer; var Value); 993 begin 994 if Index = 0 then Expression := TExpression(Value) 995 else if Index = 1 then Variable := TVariable(Value) 996 else inherited; 769 997 end; 770 998 … … 784 1012 { TIfThenElse } 785 1013 786 function TIfThenElse.GetNode(Index: Integer): TSourceNode; 787 begin 788 if Index = 0 then Result := Expression 789 else if Index = 1 then Result := CommandElse 790 else if Index = 2 then Result := CommandThen 791 else raise Exception.Create(SIndexError); 792 end; 793 794 function TIfThenElse.GetNodesCount: Integer; 1014 procedure TIfThenElse.GetValue(Index: Integer; out Value); 1015 begin 1016 if Index = 0 then TExpression(Value) := Expression 1017 else if Index = 1 then TCommand(Value) := CommandElse 1018 else if Index = 2 then TCommand(Value) := CommandThen 1019 else inherited; 1020 end; 1021 1022 function TIfThenElse.GetField(Index: Integer): TField; 1023 begin 1024 if Index = 0 then Result := TField.Create(dtObject, 'Expression') 1025 else if Index = 1 then Result := TField.Create(dtObject, 'Else') 1026 else if Index = 2 then Result := TField.Create(dtObject, 'Then') 1027 else inherited; 1028 end; 1029 1030 function TIfThenElse.GetFieldsCount: Integer; 795 1031 begin 796 1032 Result := 3; 797 1033 end; 798 1034 799 procedure TIfThenElse.Set Node(Index: Integer; AValue: TSourceNode);800 begin 801 if Index = 0 then Expression := TExpression( AValue)802 else if Index = 1 then CommandElse := TCommand( AValue)803 else if Index = 2 then CommandThen := TCommand( AValue)804 else raise Exception.Create(SIndexError);1035 procedure TIfThenElse.SetValue(Index: Integer; var Value); 1036 begin 1037 if Index = 0 then Expression := TExpression(Value) 1038 else if Index = 1 then CommandElse := TCommand(Value) 1039 else if Index = 2 then CommandThen := TCommand(Value) 1040 else inherited; 805 1041 end; 806 1042 … … 822 1058 { TWhileDo } 823 1059 824 function TWhileDo.GetNode(Index: Integer): TSourceNode; 825 begin 826 Result:=inherited GetNode(Index); 827 end; 828 829 function TWhileDo.GetNodesCount: Integer; 830 begin 831 Result:=inherited GetNodesCount; 832 end; 833 834 procedure TWhileDo.SetNode(Index: Integer; AValue: TSourceNode); 835 begin 836 inherited SetNode(Index, AValue); 1060 procedure TWhileDo.GetValue(Index: Integer; out Value); 1061 begin 1062 if Index = 0 then TExpression(Value) := Expression 1063 else if Index = 1 then TCommand(Value) := Command 1064 else inherited; 1065 end; 1066 1067 function TWhileDo.GetField(Index: Integer): TField; 1068 begin 1069 if Index = 0 then Result := TField.Create(dtObject, 'Expression') 1070 else if Index = 1 then Result := TField.Create(dtObject, 'Do') 1071 else inherited; 1072 end; 1073 1074 function TWhileDo.GetFieldsCount: Integer; 1075 begin 1076 Result := 2; 1077 end; 1078 1079 procedure TWhileDo.SetValue(Index: Integer; var Value); 1080 begin 1081 if Index = 0 then Expression := TExpression(Value) 1082 else if Index = 1 then Command := TCommand(Value) 1083 else inherited; 837 1084 end; 838 1085 … … 852 1099 { TFunctionCall } 853 1100 854 function TFunctionCall.GetNode(Index: Integer): TSourceNode; 855 begin 856 if Index = 0 then Result := FunctionDef 857 else if Index = 1 then Result := Params 858 else raise Exception.Create(SIndexError); 859 end; 860 861 function TFunctionCall.GetNodesCount: Integer; 1101 procedure TFunctionCall.GetValue(Index: Integer; out Value); 1102 begin 1103 if Index = 0 then TFunction(Value) := FunctionDef 1104 else if Index = 1 then TExpressions(Value) := Params 1105 else inherited; 1106 end; 1107 1108 function TFunctionCall.GetField(Index: Integer): TField; 1109 begin 1110 if Index = 0 then Result := TField.Create(dtObject, 'Function') 1111 else if Index = 1 then Result := TField.Create(dtObject, 'Parameters') 1112 else inherited; 1113 end; 1114 1115 function TFunctionCall.GetFieldsCount: Integer; 862 1116 begin 863 1117 Result := 2; 864 1118 end; 865 1119 866 procedure TFunctionCall.Set Node(Index: Integer; AValue: TSourceNode);867 begin 868 if Index = 0 then FunctionDef := TFunction( AValue)869 else if Index = 1 then Params := TExpressions( AValue)870 else raise Exception.Create(SIndexError);1120 procedure TFunctionCall.SetValue(Index: Integer; var Value); 1121 begin 1122 if Index = 0 then FunctionDef := TFunction(Value) 1123 else if Index = 1 then Params := TExpressions(Value) 1124 else inherited; 871 1125 end; 872 1126 … … 934 1188 { TBlock } 935 1189 936 function TBlock.GetNode(Index: Integer): TSourceNode; 937 begin 938 if Index = 0 then Result := BeginEnd 939 else if Index = 1 then Result := Types 940 else if Index = 2 then Result := Variables 941 else if Index = 3 then Result := Constants 942 else if Index = 4 then Result := Functions 943 else raise Exception.Create(SIndexError); 944 end; 945 946 function TBlock.GetNodesCount: Integer; 1190 procedure TBlock.GetValue(Index: Integer; out Value); 1191 begin 1192 if Index = 0 then TBeginEnd(Value) := BeginEnd 1193 else if Index = 1 then TTypes(Value) := Types 1194 else if Index = 2 then TVariables(Value) := Variables 1195 else if Index = 3 then TConstants(Value) := Constants 1196 else if Index = 4 then TFunctions(Value) := Functions 1197 else inherited; 1198 end; 1199 1200 function TBlock.GetField(Index: Integer): TField; 1201 begin 1202 if Index = 0 then Result := TField.Create(dtObject, 'Block') 1203 else if Index = 1 then Result := TField.Create(dtObject, 'Types') 1204 else if Index = 2 then Result := TField.Create(dtObject, 'Variables') 1205 else if Index = 3 then Result := TField.Create(dtObject, 'Constants') 1206 else if Index = 4 then Result := TField.Create(dtObject, 'Functions') 1207 else inherited; 1208 end; 1209 1210 function TBlock.GetFieldsCount: Integer; 947 1211 begin 948 1212 Result := 5; 949 1213 end; 950 1214 951 procedure TBlock.Set Node(Index: Integer; AValue: TSourceNode);952 begin 953 if Index = 0 then BeginEnd := TBeginEnd( AValue)954 else if Index = 1 then Types := TTypes( AValue)955 else if Index = 2 then Variables := TVariables( AValue)956 else if Index = 3 then Constants := TConstants( AValue)957 else if Index = 4 then Functions := TFunctions( AValue)958 else raise Exception.Create(SIndexError);1215 procedure TBlock.SetValue(Index: Integer; var Value); 1216 begin 1217 if Index = 0 then BeginEnd := TBeginEnd(Value) 1218 else if Index = 1 then Types := TTypes(Value) 1219 else if Index = 2 then Variables := TVariables(Value) 1220 else if Index = 3 then Constants := TConstants(Value) 1221 else if Index = 4 then Functions := TFunctions(Value) 1222 else inherited; 959 1223 end; 960 1224 … … 1016 1280 { TBeginEnd } 1017 1281 1018 function TBeginEnd.GetNode(Index: Integer): TSourceNode; 1019 begin 1020 if Index = 0 then Result := Commands 1021 else raise Exception.Create(SIndexError); 1022 end; 1023 1024 function TBeginEnd.GetNodesCount: Integer; 1282 procedure TBeginEnd.GetValue(Index: Integer; out Value); 1283 begin 1284 if Index = 0 then TCommands(Value) := Commands 1285 else inherited; 1286 end; 1287 1288 function TBeginEnd.GetField(Index: Integer): TField; 1289 begin 1290 if Index = 0 then Result := TField.Create(dtObject, 'Command') 1291 else inherited; 1292 end; 1293 1294 function TBeginEnd.GetFieldsCount: Integer; 1025 1295 begin 1026 1296 Result := 1; 1027 1297 end; 1028 1298 1029 procedure TBeginEnd.Set Node(Index: Integer; AValue: TSourceNode);1030 begin 1031 if Index = 0 then Commands := TCommands( AValue)1032 else raise Exception.Create(SIndexError);1299 procedure TBeginEnd.SetValue(Index: Integer; var Value); 1300 begin 1301 if Index = 0 then Commands := TCommands(Value) 1302 else inherited; 1033 1303 end; 1034 1304 … … 1051 1321 { TProgram } 1052 1322 1053 function TProgram.GetNode(Index: Integer): TSourceNode; 1054 begin 1055 if Index = 0 then Result := Block 1323 procedure TProgram.GetValue(Index: Integer; out Value); 1324 begin 1325 if Index = 0 then string(Value) := Name 1326 else if Index = 1 then TBlock(Value) := Block 1056 1327 else raise Exception.Create(SIndexError); 1057 1328 end; 1058 1329 1059 function TProgram.GetNodesCount: Integer; 1060 begin 1061 Result := 1; 1062 end; 1063 1064 procedure TProgram.SetNode(Index: Integer; AValue: TSourceNode); 1065 begin 1066 if Index = 0 then Block := TBlock(AValue) 1330 function TProgram.GetField(Index: Integer): TField; 1331 begin 1332 if Index = 0 then Result := TField.Create(dtString, 'Name') 1333 else if Index = 1 then Result := TField.Create(dtObject, 'Block') 1334 else inherited; 1335 end; 1336 1337 function TProgram.GetFieldsCount: Integer; 1338 begin 1339 Result := 2; 1340 end; 1341 1342 procedure TProgram.SetValue(Index: Integer; var Value); 1343 begin 1344 if Index = 0 then Name := string(Value) 1345 else if Index = 0 then Block := TBlock(Value) 1067 1346 else raise Exception.Create(SIndexError); 1068 1347 end; … … 1087 1366 1088 1367 1089 1090 1368 end. 1091 1369 -
branches/interpreter2/interpreter.lpi
r207 r208 72 72 </Item2> 73 73 </RequiredPackages> 74 <Units Count="1 4">74 <Units Count="16"> 75 75 <Unit0> 76 76 <Filename Value="interpreter.lpr"/> … … 138 138 <IsPartOfProject Value="True"/> 139 139 </Unit13> 140 <Unit14> 141 <Filename Value="UGeneratorXml.pas"/> 142 <IsPartOfProject Value="True"/> 143 </Unit14> 144 <Unit15> 145 <Filename Value="Forms/UFormOutput.pas"/> 146 <IsPartOfProject Value="True"/> 147 <ComponentName Value="FormOutput"/> 148 <ResourceBaseClass Value="Form"/> 149 </Unit15> 140 150 </Units> 141 151 </ProjectOptions> -
branches/interpreter2/interpreter.lpr
r207 r208 10 10 Forms, UFormMain, UParser, UTokenizer, USource, UExecutor, UInterpreter, 11 11 UGeneratorPascal, UGeneratorPhp, UGenerator, UGeneratorCSharp, UFormMessages, 12 UFormSource, UOptimizer 12 UFormSource, UOptimizer, UGeneratorXml, UFormOutput 13 13 { you can add units after this }; 14 14 … … 31 31 Application.CreateForm(TFormMessages, FormMessages); 32 32 Application.CreateForm(TFormSource, FormSource); 33 Application.CreateForm(TFormOutput, FormOutput); 33 34 Application.Run; 34 35 end.
Note:
See TracChangeset
for help on using the changeset viewer.