Changeset 75 for trunk/Compiler/Modules/Pascal
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (6 months ago)
- Location:
- trunk/Compiler/Modules/Pascal
- Files:
-
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Modules/Pascal/AnalyzerPascal.pas
r74 r75 1 unit UAnalyzerPascal; 2 3 {$mode delphi} 1 unit AnalyzerPascal; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UAnalyzer, USourceCodePascal, Dialogs, USourceConvertor;6 Classes, SysUtils, Analyzer, SourceCodePascal, Dialogs, SourceConvertor; 9 7 10 8 type … … 16 14 public 17 15 Parser: TAnalyzer; 18 function DebugExpressions(List: T ListExpression): string;16 function DebugExpressions(List: TExpressions): string; 19 17 function ParseFile(Name: string): Boolean; 20 18 function ParseWhileDo(var WhileDo: TWhileDo; SourceCode: TCommonBlock): Boolean; 21 19 function ParseExpression(SourceCode: TExpression): Boolean; 22 20 function ParseExpressionParenthases(SourceCode: TExpression; 23 Expressions: T ListExpression): Boolean;21 Expressions: TExpressions): Boolean; 24 22 function ParseExpressionOperator(SourceCode: TExpression; 25 Expressions: T ListExpression): Boolean;23 Expressions: TExpressions): Boolean; 26 24 function ParseExpressionRightValue(SourceCode: TExpression; 27 Expressions: T ListExpression): Boolean;25 Expressions: TExpressions): Boolean; 28 26 function ParseExpressionFunctionCall(SourceCode: TExpression; 29 Expressions: T ListExpression; var Func: TFunctionCall): Boolean;30 function ParseUses(SourceCode: TUsedModule List; AExported: Boolean): Boolean;31 function ParseUsesItem(SourceCode: TUsedModule List; AExported: Boolean): Boolean;27 Expressions: TExpressions; var Func: TFunctionCall): Boolean; 28 function ParseUses(SourceCode: TUsedModules; AExported: Boolean): Boolean; 29 function ParseUsesItem(SourceCode: TUsedModules; AExported: Boolean): Boolean; 32 30 function ParseModule(ProgramCode: TProgram): TSourceModule; 33 31 function ParseUnit(var SourceCode: TModuleUnit; ProgramCode: TProgram): Boolean; … … 40 38 function ParseCommand(SourceCode: TCommonBlock): TCommand; 41 39 function ParseBeginEnd(var BeginEnd: TBeginEnd; SourceCode: TCommonBlock): Boolean; 42 function ParseFunction(SourceCode: TFunction List; Exported: Boolean = False): Boolean;40 function ParseFunction(SourceCode: TFunctions; Exported: Boolean = False): Boolean; 43 41 procedure ParseFunctionParameters(SourceCode: TFunction; ValidateParams: Boolean = False); 44 42 function ParseIfThenElse(var IfThenElse: TIfThenElse; SourceCode: TCommonBlock): Boolean; … … 46 44 function ParseAssigment(var Assignment: TAssignment; SourceCode: TCommonBlock): Boolean; 47 45 function ParseFunctionCall(var Call: TFunctionCall; SourceCode: TCommonBlock): Boolean; 48 function ParseVariableList(SourceCode: TVariable List; Exported: Boolean = False): Boolean;49 procedure ParseVariable(SourceCode: TVariable List; Exported: Boolean = False);50 function ParseConstantList(SourceCode: TConstant List; Exported: Boolean = False): Boolean;51 function ParseConstant(SourceCode: TConstant List; Exported: Boolean = False): Boolean;52 function ParseType(TypeList: TType List; var NewType: TType; ExpectName: Boolean = True;46 function ParseVariableList(SourceCode: TVariables; Exported: Boolean = False): Boolean; 47 procedure ParseVariable(SourceCode: TVariables; Exported: Boolean = False); 48 function ParseConstantList(SourceCode: TConstants; Exported: Boolean = False): Boolean; 49 function ParseConstant(SourceCode: TConstants; Exported: Boolean = False): Boolean; 50 function ParseType(TypeList: TTypes; var NewType: TType; ExpectName: Boolean = True; 53 51 AssignSymbol: string = '='; ForwardDeclaration: Boolean = False): Boolean; 54 52 function ParseTypeParameters(var NewType: TType): Boolean; … … 86 84 SNotRecordOrClass = '"%s" not record or class'; 87 85 86 88 87 implementation 89 88 90 89 { TAnalyzerPascal } 91 90 92 function TAnalyzerPascal.DebugExpressions(List: T ListExpression): string;91 function TAnalyzerPascal.DebugExpressions(List: TExpressions): string; 93 92 var 94 93 I: Integer; … … 152 151 function TAnalyzerPascal.ParseExpression(SourceCode: TExpression): Boolean; 153 152 var 154 Expressions: T ListExpression;153 Expressions: TExpressions; 155 154 I: Integer; 156 155 II: Integer; … … 158 157 (* with Parser do 159 158 try 160 Expressions := T ListExpression.Create;159 Expressions := TExpressions.Create; 161 160 Expressions.Add(TExpression.Create); 162 161 with SourceCode do begin … … 206 205 207 206 function TAnalyzerPascal.ParseExpressionParenthases(SourceCode: TExpression; 208 Expressions: T ListExpression): Boolean;207 Expressions: TExpressions): Boolean; 209 208 var 210 209 NewExpression: TExpression; … … 230 229 231 230 function TAnalyzerPascal.ParseExpressionOperator(SourceCode: TExpression; 232 Expressions: T ListExpression): Boolean;231 Expressions: TExpressions): Boolean; 233 232 begin 234 233 (*if IsOperator(NextToken) then begin … … 241 240 242 241 function TAnalyzerPascal.ParseExpressionRightValue(SourceCode: TExpression; 243 Expressions: T ListExpression): Boolean;242 Expressions: TExpressions): Boolean; 244 243 var 245 244 UseType: TType; … … 348 347 end; 349 348 if Assigned(NewExpression) then begin 350 TExpression(Expressions.Last).SubItems .Last:= NewExpression;349 TExpression(Expressions.Last).SubItems[TExpression(Expressions.Last).SubItems.Count - 1] := NewExpression; 351 350 with TExpression(Expressions.Items[Expressions.Add(TExpression.Create)]) do 352 351 begin 353 352 CommonBlock := SourceCode.CommonBlock; 354 SubItems .First:= NewExpression;353 SubItems[0] := NewExpression; 355 354 end; 356 355 Result := True; … … 364 363 365 364 function TAnalyzerPascal.ParseExpressionFunctionCall(SourceCode: TExpression; 366 Expressions: T ListExpression; var Func: TFunctionCall): Boolean;365 Expressions: TExpressions; var Func: TFunctionCall): Boolean; 367 366 var 368 367 UseFunction: TFunction; … … 666 665 { TParserParseFunctionList } 667 666 668 function TAnalyzerPascal.ParseFunction(SourceCode: TFunction List;667 function TAnalyzerPascal.ParseFunction(SourceCode: TFunctions; 669 668 Exported: Boolean = False): Boolean; 670 669 var … … 796 795 while (NextToken <> ')') and (NextTokenType <> ttEndOfFile) do begin 797 796 // while IsIdentificator(NextCode) do begin 798 with TParameter List(Parameters) do begin797 with TParameters(Parameters) do begin 799 798 VariableName := ReadToken; 800 799 if VariableName = 'var' then begin … … 948 947 { TParserVariableList } 949 948 950 function TAnalyzerPascal.ParseVariableList(SourceCode: TVariable List; Exported: Boolean = False): Boolean;949 function TAnalyzerPascal.ParseVariableList(SourceCode: TVariables; Exported: Boolean = False): Boolean; 951 950 var 952 951 NewValueType: TType; … … 968 967 { TParserVariable } 969 968 970 procedure TAnalyzerPascal.ParseVariable(SourceCode: TVariable List; Exported: Boolean = False);969 procedure TAnalyzerPascal.ParseVariable(SourceCode: TVariables; Exported: Boolean = False); 971 970 var 972 971 VariableName: string; … … 1016 1015 { TParserConstantList } 1017 1016 1018 function TAnalyzerPascal.ParseConstantList(SourceCode: TConstant List; Exported: Boolean = False): Boolean;1017 function TAnalyzerPascal.ParseConstantList(SourceCode: TConstants; Exported: Boolean = False): Boolean; 1019 1018 begin 1020 1019 with Parser do … … 1030 1029 end; 1031 1030 1032 function TAnalyzerPascal.ParseConstant(SourceCode: TConstant List;1031 function TAnalyzerPascal.ParseConstant(SourceCode: TConstants; 1033 1032 Exported: Boolean): Boolean; 1034 1033 var … … 1082 1081 { TParserType } 1083 1082 1084 function TAnalyzerPascal.ParseType(TypeList: TType List; var NewType: TType; ExpectName: Boolean = True;1083 function TAnalyzerPascal.ParseType(TypeList: TTypes; var NewType: TType; ExpectName: Boolean = True; 1085 1084 AssignSymbol: string = '='; ForwardDeclaration: Boolean = False): Boolean; 1086 1085 begin … … 1471 1470 { TParserUsedModuleList } 1472 1471 1473 function TAnalyzerPascal.ParseUses(SourceCode: TUsedModule List; AExported: Boolean): Boolean;1472 function TAnalyzerPascal.ParseUses(SourceCode: TUsedModules; AExported: Boolean): Boolean; 1474 1473 var 1475 1474 NewUsedModule: TUsedModule; … … 1488 1487 end; 1489 1488 1490 function TAnalyzerPascal.ParseUsesItem(SourceCode: TUsedModule List;1489 function TAnalyzerPascal.ParseUsesItem(SourceCode: TUsedModules; 1491 1490 AExported: Boolean): Boolean; 1492 1491 begin -
trunk/Compiler/Modules/Pascal/ModulePascal.pas
r74 r75 1 unit UModulePascal; 2 3 {$mode delphi}{$H+} 1 unit ModulePascal; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UModularSystem, UAnalyzerPascal;6 Classes, SysUtils, ModularSystem, AnalyzerPascal; 9 7 10 8 type … … 24 22 25 23 uses 26 UCompilerAPI;24 CompilerAPI; 27 25 28 26 { TModulePascal } … … 31 29 begin 32 30 inherited; 33 Name:= 'Pascal';31 Identification := 'Pascal'; 34 32 Title := 'Pascal'; 35 33 Version := '0.1'; … … 38 36 destructor TModulePascal.Destroy; 39 37 begin 40 inherited Destroy;38 inherited; 41 39 end; 42 40 -
trunk/Compiler/Modules/Pascal/SourceCodePascal.pas
r74 r75 1 unit USourceCodePascal; 2 3 {$MODE Delphi} 4 {$MACRO ON} 1 unit SourceCodePascal; 5 2 6 3 interface 7 4 8 5 uses 9 SysUtils, Variants, Classes, Dialogs, SpecializedList, USourceConvertor;6 SysUtils, Variants, Classes, Dialogs, Generics.Collections, SourceConvertor; 10 7 11 8 type … … 22 19 23 20 TCommonBlock = class; 24 TType List= class;25 TConstant List= class;26 TVariable List= class;27 TFunction List= class;28 T ListExpression= class;21 TTypes = class; 22 TConstants = class; 23 TVariables = class; 24 TFunctions = class; 25 TExpressions = class; 29 26 TExpression = class; 30 27 TFunction = class; … … 40 37 41 38 TContext = class 42 43 end; 44 45 TCommandList = class; 39 end; 40 41 TCommands = class; 46 42 47 43 TCommand = class … … 57 53 end; 58 54 59 // TListExpression = TGObjectList<Integer, TExpression> 60 TListExpression = class(TListObject); 55 { TExpressions } 56 57 TExpressions = class(TObjectList<TExpression>) 58 procedure Assign(Source: TExpressions); 59 end; 61 60 62 61 { TFunctionCall } … … 64 63 TFunctionCall = class(TCommand) 65 64 FunctionRef: TFunction; 66 ParameterExpression: T ListExpression;65 ParameterExpression: TExpressions; 67 66 constructor Create; 68 67 destructor Destroy; override; … … 70 69 71 70 TBeginEnd = class(TCommand) 72 Commands: TCommand List;71 Commands: TCommands; 73 72 CommonBlock: TCommonBlock; 74 73 procedure Clear; … … 90 89 91 90 TRepeatUntil = class(TCommand) 92 Block: TCommand List;91 Block: TCommands; 93 92 Condition: TExpression; 94 93 end; … … 120 119 end; 121 120 122 // TListCaseOfEndBranche = TGObjectList<Integer, TCaseOfEndBranche> 123 TListCaseOfEndBranche = class(TListObject); 121 TListCaseOfEndBranche = class(TObjectList<TCaseOfEndBranche>); 124 122 125 123 TCaseOfEnd = class(TCommand) … … 132 130 133 131 TTryFinally = class(TCommand) 134 Block: TCommand List;135 FinallyBlock: TCommand List;132 Block: TCommands; 133 FinallyBlock: TCommands; 136 134 end; 137 135 138 136 TTryExcept = class(TCommand) 139 Block: TCommandList; 140 ExceptBlock: TCommandList; 141 end; 142 143 // TCommandList = TGObjectList<Integer, TCommand> 144 TCommandList = class(TListObject); 137 Block: TCommands; 138 ExceptBlock: TCommands; 139 end; 140 141 TCommands = class(TObjectList<TCommand>); 145 142 146 143 TCommonBlockSection = (cbsVariable, cbsType, cbsConstant); … … 150 147 Parent: TCommonBlock; 151 148 ParentModule: TSourceModule; 152 Constants: TConstant List;153 Types: TType List;154 Variables: TVariable List;155 Functions: TFunction List;156 Order: T ListObject;149 Constants: TConstants; 150 Types: TTypes; 151 Variables: TVariables; 152 Functions: TFunctions; 153 Order: TObjectList<TObject>; 157 154 Code: TBeginEnd; 158 155 constructor Create; virtual; … … 166 163 ForwardDeclared: Boolean; 167 164 Internal: Boolean; 168 Parent: TType List;165 Parent: TTypes; 169 166 Name: string; 170 167 Size: Integer; … … 172 169 Exported: Boolean; 173 170 Visibility: TTypeVisibility; 174 Parameters: TType List;171 Parameters: TTypes; 175 172 procedure Assign(Source: TType); 176 173 constructor Create; … … 178 175 end; 179 176 180 // TListType = TGObjectList<Integer, TType> 181 TListType = class(TListObject); 182 183 TTypeList = class(TListType) 177 { TTypes } 178 179 TTypes = class(TObjectList<TType>) 184 180 Parent: TCommonBlock; 185 181 function Search(Name: string; Exported: Boolean = False): TType; 186 182 destructor Destroy; override; 183 function AddNew: TType; 187 184 end; 188 185 … … 214 211 end; 215 212 216 // TListEnumItem = TGObjectList<Integer, TEnumItem> 217 TListEnumItem = class(TListObject); 213 TEnumItems = class(TObjectList<TEnumItem>); 218 214 219 215 TTypeEnumeration = class(TType) 220 Items: T ListEnumItem;216 Items: TEnumItems; 221 217 constructor Create; 222 218 destructor Destroy; override; … … 239 235 end; 240 236 241 // TListConstant = TGObjectList<Integer, TConstant> 242 TListConstant = class(TListObject); 243 244 TConstantList = class(TListConstant) 237 TConstants = class(TObjectList<TConstant>) 245 238 Parent: TCommonBlock; 246 239 function Search(Name: string): TConstant; … … 256 249 end; 257 250 258 // TListVariable = TGObjectList<Integer, TVariable> 259 TListVariable = class(TListObject); 260 261 TVariableList = class(TListVariable) 251 TVariables = class(TObjectList<TVariable>) 262 252 Parent: TCommonBlock; 263 253 function Search(Name: string; Exported: Boolean = False): TVariable; … … 268 258 end; 269 259 270 // TListParameter = TGObjectList<Integer, TParameter> 271 TListParameter = class(TListObject); 272 273 TParameterList = class(TListParameter) 260 TParameters = class(TObjectList<TParameter>) 274 261 Parent: TFunction; 275 262 function Search(Name: string): TParameter; … … 288 275 Value: TValue; 289 276 OperatorName: string; 290 SubItems: T ListExpression;277 SubItems: TExpressions; 291 278 Associated: Boolean; 292 279 Braces: Boolean; … … 302 289 Internal: Boolean; 303 290 FunctionType: TFunctionType; 304 Parameters: TParameter List;291 Parameters: TParameters; 305 292 ResultType: TType; 306 293 Exported: Boolean; … … 310 297 end; 311 298 312 // TListFunction = TGObjectList<Integer, TFunction> 313 TListFunction = class(TListObject); 314 315 TFunctionList = class(TListFunction) 299 { TFunctions } 300 301 TFunctions = class(TObjectList<TFunction>) 316 302 Parent: TCommonBlock; 317 303 function Search(Name: string; Exported: Boolean = False): TFunction; 318 304 destructor Destroy; override; 305 function AddNew: TFunction; 319 306 end; 320 307 … … 326 313 end; 327 314 328 // TListUsedModule = TGObjectList<Integer, TUsedModule> 329 TListUsedModule = class(TListObject); 330 331 TUsedModuleList = class(TListUsedModule) 315 TUsedModules = class(TObjectList<TUsedModule>) 332 316 ParentModule: TSourceModule; 333 317 end; … … 340 324 Name: string; 341 325 TargetFile: string; 342 UsedModules: TUsedModule List;326 UsedModules: TUsedModules; 343 327 Body: TCommonBlock; 344 328 Internal: Boolean; … … 374 358 end; 375 359 376 // TListModule = TGObjectList<Integer, TModule> 377 TListModule = class(TListObject); 378 379 { TModuleList } 380 381 TModuleList = class(TListModule) 360 { TModules } 361 362 TModules = class(TObjectList<TSourceModule>) 382 363 function Search(Name: string): TSourceModule; 383 364 end; … … 387 368 TProgram = class(TSource) 388 369 Device: TDevice; 389 Modules: TModule List;370 Modules: TModules; 390 371 MainModule: TSourceModule; 391 372 procedure Clear; … … 408 389 SAssignmentError = 'Assignment error'; 409 390 391 410 392 implementation 411 393 … … 415 397 begin 416 398 inherited; 417 Parameters := TParameter List.Create;399 Parameters := TParameters.Create; 418 400 Parameters.Parent := Self; 419 401 //ResultType := TType.Create; … … 422 404 destructor TFunction.Destroy; 423 405 begin 424 Parameters.Free;425 // ResultType.Free;406 FreeAndNil(Parameters); 407 // FreeAndNil(ResultType); 426 408 inherited; 427 409 end; … … 438 420 begin 439 421 Device := TDevice.Create; 440 Modules := TModule List.Create;422 Modules := TModules.Create; 441 423 end; 442 424 443 425 destructor TProgram.Destroy; 444 426 begin 445 Modules.Free; 446 Device.Free; 447 end; 448 449 { TConstant } 450 451 452 { TConstantList } 453 454 destructor TConstantList.Destroy; 455 begin 456 inherited; 457 end; 458 459 function TConstantList.Search(Name: string): TConstant; 427 FreeAndNil(Modules); 428 FreeAndNil(Device); 429 end; 430 431 { TConstants } 432 433 destructor TConstants.Destroy; 434 begin 435 inherited; 436 end; 437 438 function TConstants.Search(Name: string): TConstant; 460 439 var 461 440 I: Integer; … … 476 455 begin 477 456 inherited; 478 UsedModules := TUsedModule List.Create;457 UsedModules := TUsedModules.Create; 479 458 UsedModules.ParentModule := Self; 480 459 Body := TCommonBlock.Create; … … 484 463 destructor TSourceModule.Destroy; 485 464 begin 486 Body.Free;487 UsedModules.Free;465 FreeAndNil(Body); 466 FreeAndNil(UsedModules); 488 467 inherited; 489 468 end; … … 504 483 constructor TCommonBlock.Create; 505 484 begin 506 Constants := TConstant List.Create;485 Constants := TConstants.Create; 507 486 Constants.Parent := Self; 508 Types := TType List.Create;487 Types := TTypes.Create; 509 488 Types.Parent := Self; 510 Variables := TVariable List.Create;489 Variables := TVariables.Create; 511 490 Variables.Parent := Self; 512 Functions := TFunction List.Create;491 Functions := TFunctions.Create; 513 492 Functions.Parent := Self; 514 493 Code := TBeginEnd.Create; 515 494 Code.Parent := Self; 516 495 Code.CommonBlock := Self; 517 Order := T ListObject.Create;496 Order := TObjectList<TObject>.Create; 518 497 Order.OwnsObjects := False; 519 498 end; … … 521 500 destructor TCommonBlock.Destroy; 522 501 begin 523 Constants.Free; 524 Types.Free; 525 Variables.Free; 526 Functions.Free; 527 Code.Free; 528 Order.Free; 529 inherited; 530 end; 531 532 { TTypeList } 533 534 destructor TTypeList.Destroy; 535 begin 536 inherited; 537 end; 538 539 function TTypeList.Search(Name: string; Exported: Boolean = False): TType; 502 FreeAndNil(Constants); 503 FreeAndNil(Types); 504 FreeAndNil(Variables); 505 FreeAndNil(Functions); 506 FreeAndNil(Code); 507 FreeAndNil(Order); 508 inherited; 509 end; 510 511 { TTypes } 512 513 destructor TTypes.Destroy; 514 begin 515 inherited; 516 end; 517 518 function TTypes.AddNew: TType; 519 begin 520 Result := TType.Create; 521 Add(Result); 522 end; 523 524 function TTypes.Search(Name: string; Exported: Boolean = False): TType; 540 525 var 541 526 I: Integer; … … 557 542 end; 558 543 559 { TVariable List}560 561 destructor TVariable List.Destroy;562 begin 563 inherited; 564 end; 565 566 function TVariable List.Search(Name: string; Exported: Boolean = False): TVariable;544 { TVariables } 545 546 destructor TVariables.Destroy; 547 begin 548 inherited; 549 end; 550 551 function TVariables.Search(Name: string; Exported: Boolean = False): TVariable; 567 552 var 568 553 I: Integer; … … 602 587 end; 603 588 604 { TFunctionList } 605 606 destructor TFunctionList.Destroy; 607 begin 608 inherited; 609 end; 610 611 function TFunctionList.Search(Name: string; Exported: Boolean): TFunction; 589 { TFunctions } 590 591 destructor TFunctions.Destroy; 592 begin 593 inherited; 594 end; 595 596 function TFunctions.AddNew: TFunction; 597 begin 598 Result := TFunction.Create; 599 Add(Result); 600 end; 601 602 function TFunctions.Search(Name: string; Exported: Boolean): TFunction; 612 603 var 613 604 I: Integer; … … 631 622 constructor TExpression.Create; 632 623 begin 633 SubItems := T ListExpression.Create;624 SubItems := TExpressions.Create; 634 625 SubItems.Count := 2; 635 626 SubItems.OwnsObjects := False; … … 638 629 destructor TExpression.Destroy; 639 630 begin 640 SubItems.Free;631 FreeAndNil(SubItems); 641 632 inherited; 642 633 end; … … 654 645 end; 655 646 656 { TParameter List}657 658 destructor TParameter List.Destroy;659 begin 660 inherited; 661 end; 662 663 function TParameter List.Search(Name: string): TParameter;647 { TParameters } 648 649 destructor TParameters.Destroy; 650 begin 651 inherited; 652 end; 653 654 function TParameters.Search(Name: string): TParameter; 664 655 var 665 656 I: Integer; … … 675 666 procedure TBeginEnd.Clear; 676 667 begin 677 678 668 end; 679 669 … … 681 671 begin 682 672 inherited; 683 Commands := TCommand List.Create;673 Commands := TCommands.Create; 684 674 end; 685 675 686 676 destructor TBeginEnd.Destroy; 687 677 begin 688 Commands.Free;678 FreeAndNil(Commands); 689 679 inherited; 690 680 end; … … 699 689 destructor TAssignment.Destroy; 700 690 begin 701 Source.Free; 702 inherited; 691 FreeAndNil(Source); 692 inherited; 693 end; 694 695 { TExpressions } 696 697 procedure TExpressions.Assign(Source: TExpressions); 698 var 699 I: Integer; 700 begin 701 while Count > Source.Count do Delete(Count - 1); 702 while Count < Source.Count do Add(TExpression.Create); 703 for I := 0 to Count - 1 do 704 Items[I].Assign(Source[I]); 703 705 end; 704 706 … … 713 715 destructor TWhileDo.Destroy; 714 716 begin 715 Condition.Free;716 Command.Free;717 FreeAndNil(Condition); 718 FreeAndNil(Command); 717 719 inherited; 718 720 end; … … 728 730 destructor TCaseOfEnd.Destroy; 729 731 begin 730 Branches.Free;732 FreeAndNil(Branches); 731 733 inherited; 732 734 end; … … 741 743 destructor TIfThenElse.Destroy; 742 744 begin 743 Condition.Free;744 inherited Destroy;745 FreeAndNil(Condition); 746 inherited; 745 747 end; 746 748 … … 750 752 begin 751 753 inherited; 752 ParameterExpression := T ListExpression.Create;754 ParameterExpression := TExpressions.Create; 753 755 end; 754 756 755 757 destructor TFunctionCall.Destroy; 756 758 begin 757 ParameterExpression.Free;758 inherited Destroy;759 FreeAndNil(ParameterExpression); 760 inherited; 759 761 end; 760 762 … … 770 772 destructor TForToDo.Destroy; 771 773 begin 772 Start.Free;773 Stop.Free;;774 inherited Destroy;774 FreeAndNil(Start); 775 FreeAndNil(Stop); 776 inherited; 775 777 end; 776 778 … … 785 787 destructor TTypeRecord.Destroy; 786 788 begin 787 CommonBlock.Free;788 inherited Destroy;789 end; 790 791 { TModule List}792 793 function TModule List.Search(Name: string): TSourceModule;789 FreeAndNil(CommonBlock); 790 inherited; 791 end; 792 793 { TModules } 794 795 function TModules.Search(Name: string): TSourceModule; 794 796 var 795 797 I: Integer; … … 820 822 function TSourceModule.SearchConstant(Name: string; Outside: Boolean): TConstant; 821 823 begin 822 823 824 end; 824 825 … … 864 865 destructor TModuleProgram.Destroy; 865 866 begin 866 inherited Destroy;867 inherited; 867 868 end; 868 869 … … 881 882 destructor TModuleUnit.Destroy; 882 883 begin 883 InititializeSection.Free;884 F inalalizeSection.Free;885 inherited Destroy;884 FreeAndNil(InititializeSection); 885 FreeAndNil(FinalalizeSection); 886 inherited; 886 887 end; 887 888 … … 891 892 begin 892 893 inherited; 893 Items := T ListEnumItem.Create;894 Items := TEnumItems.Create; 894 895 end; 895 896 896 897 destructor TTypeEnumeration.Destroy; 897 898 begin 898 Items.Free;899 inherited Destroy;899 FreeAndNil(Items); 900 inherited; 900 901 end; 901 902 … … 910 911 destructor TTypeClass.Destroy; 911 912 begin 912 CommonBlock.Free;913 inherited Destroy;913 FreeAndNil(CommonBlock); 914 inherited; 914 915 end; 915 916 … … 942 943 constructor TType.Create; 943 944 begin 944 Parameters := TType List.Create;945 Parameters := TTypes.Create; 945 946 //Parameters.Parent := Parent.Parent; 946 947 end; … … 948 949 destructor TType.Destroy; 949 950 begin 950 Parameters.Free;951 inherited Destroy;951 FreeAndNil(Parameters); 952 inherited; 952 953 end; 953 954
Note:
See TracChangeset
for help on using the changeset viewer.