Ignore:
Timestamp:
Aug 10, 2010, 1:48:38 PM (14 years ago)
Author:
george
Message:

Fix: View proper source file after click to error message.
Made partial changes to support unit interface and implementation sections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/USourceCode.pas

    r54 r55  
    270270  end;
    271271
    272   TModule = class(TCommonBlock)
     272  TModule = class
    273273  public
    274     ModuleType: TModuleType;
     274    Name: string;
     275    constructor Create;
     276    destructor Destroy; override;
     277  end;
     278
     279  { TModuleProgram }
     280
     281  TModuleProgram = class(TModule)
    275282    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)
    279320  end;
    280321
     
    362403{ TModule }
    363404
    364 procedure TModule.Clear;
    365 begin
    366   Variables.Clear;
    367   Constants.Clear;
    368   Functions.Clear;
    369   Code.Clear;
    370 end;
    371 
    372405constructor TModule.Create;
    373406begin
    374407  inherited;
    375   UsedModules := TUsedModuleList.Create;
    376408end;
    377409
    378410destructor TModule.Destroy;
    379411begin
    380   UsedModules.Destroy;
    381412  inherited;
    382413end;
     
    694725end;
    695726
     727{ TModuleProgram }
     728
     729constructor TModuleProgram.Create;
     730begin
     731  inherited;
     732  UsedModules := TUsedModuleList.Create;
     733  Body := TCommonBlock.Create;
     734end;
     735
     736destructor TModuleProgram.Destroy;
     737begin
     738  UsedModules.Free;
     739  Body.Free;
     740  inherited Destroy;
     741end;
     742
     743{ TModuleUnit }
     744
     745constructor TModuleUnit.Create;
     746begin
     747  ImplementationSection := TUnitImplementation.Create;
     748  InterfaceSection := TUnitInterface.Create;
     749end;
     750
     751destructor TModuleUnit.Destroy;
     752begin
     753  ImplementationSection.Free;
     754  InterfaceSection.Free;
     755  inherited Destroy;
     756end;
     757
     758{ TUnitImplementation }
     759
     760constructor TUnitImplementation.Create;
     761begin
     762  UsedModules := TUsedModuleList.Create;
     763  Body := TCommonBlock.Create;
     764end;
     765
     766destructor TUnitImplementation.Destroy;
     767begin
     768  UsedModules.Free;
     769  Body.Free;
     770  inherited Destroy;
     771end;
     772
     773{ TUnitInterface }
     774
     775constructor TUnitInterface.Create;
     776begin
     777  UsedModules := TUsedModuleList.Create;
     778  Body := TCommonBlock.Create;
     779end;
     780
     781destructor TUnitInterface.Destroy;
     782begin
     783  UsedModules.Free;
     784  Body.Free;
     785  inherited Destroy;
     786end;
     787
    696788end.
    697789
Note: See TracChangeset for help on using the changeset viewer.