Changeset 55 for branches/DelphiToC/USourceCode.pas
- Timestamp:
- Aug 10, 2010, 1:48:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/USourceCode.pas
r54 r55 270 270 end; 271 271 272 TModule = class (TCommonBlock)272 TModule = class 273 273 public 274 ModuleType: TModuleType; 274 Name: string; 275 constructor Create; 276 destructor Destroy; override; 277 end; 278 279 { TModuleProgram } 280 281 TModuleProgram = class(TModule) 275 282 UsedModules: TUsedModuleList; 276 constructor Create; override; 277 procedure Clear; 278 destructor Destroy; override; 283 Body: TCommonBlock; 284 constructor Create; 285 destructor Destroy; override; 286 end; 287 288 { TUnitInterface } 289 290 TUnitInterface = class 291 UsedModules: TUsedModuleList; 292 Body: TCommonBlock; 293 constructor Create; 294 destructor Destroy; override; 295 end; 296 297 { TUnitImplementation } 298 299 TUnitImplementation = class 300 UsedModules: TUsedModuleList; 301 Body: TCommonBlock; 302 constructor Create; 303 destructor Destroy; override; 304 end; 305 306 { TModuleUnit } 307 308 TModuleUnit = class(TModule) 309 InterfaceSection: TUnitInterface; 310 ImplementationSection: TUnitImplementation; 311 constructor Create; 312 destructor Destroy; override; 313 end; 314 315 TModulePackage = class(TModule) 316 317 end; 318 319 TModuleLibrary = class(TModule) 279 320 end; 280 321 … … 362 403 { TModule } 363 404 364 procedure TModule.Clear;365 begin366 Variables.Clear;367 Constants.Clear;368 Functions.Clear;369 Code.Clear;370 end;371 372 405 constructor TModule.Create; 373 406 begin 374 407 inherited; 375 UsedModules := TUsedModuleList.Create;376 408 end; 377 409 378 410 destructor TModule.Destroy; 379 411 begin 380 UsedModules.Destroy;381 412 inherited; 382 413 end; … … 694 725 end; 695 726 727 { TModuleProgram } 728 729 constructor TModuleProgram.Create; 730 begin 731 inherited; 732 UsedModules := TUsedModuleList.Create; 733 Body := TCommonBlock.Create; 734 end; 735 736 destructor TModuleProgram.Destroy; 737 begin 738 UsedModules.Free; 739 Body.Free; 740 inherited Destroy; 741 end; 742 743 { TModuleUnit } 744 745 constructor TModuleUnit.Create; 746 begin 747 ImplementationSection := TUnitImplementation.Create; 748 InterfaceSection := TUnitInterface.Create; 749 end; 750 751 destructor TModuleUnit.Destroy; 752 begin 753 ImplementationSection.Free; 754 InterfaceSection.Free; 755 inherited Destroy; 756 end; 757 758 { TUnitImplementation } 759 760 constructor TUnitImplementation.Create; 761 begin 762 UsedModules := TUsedModuleList.Create; 763 Body := TCommonBlock.Create; 764 end; 765 766 destructor TUnitImplementation.Destroy; 767 begin 768 UsedModules.Free; 769 Body.Free; 770 inherited Destroy; 771 end; 772 773 { TUnitInterface } 774 775 constructor TUnitInterface.Create; 776 begin 777 UsedModules := TUsedModuleList.Create; 778 Body := TCommonBlock.Create; 779 end; 780 781 destructor TUnitInterface.Destroy; 782 begin 783 UsedModules.Free; 784 Body.Free; 785 inherited Destroy; 786 end; 787 696 788 end. 697 789
Note:
See TracChangeset
for help on using the changeset viewer.