Ignore:
Timestamp:
Jul 30, 2012, 3:52:56 PM (12 years ago)
Author:
chronos
Message:
  • Added: Addon modules support.
  • Modified: Restored usage of URegistry unit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/USourceCode.pas

    r63 r68  
    3131  TVariable = class;
    3232  TConstant = class;
    33   TModule = class;
     33  TSourceModule = class;
    3434  TProgram = class;
    3535
     
    149149    Name: string;
    150150    Parent: TCommonBlock;
    151     ParentModule: TModule;
     151    ParentModule: TSourceModule;
    152152    Constants: TConstantList;
    153153    Types: TTypeList;
     
    322322    Name: string;
    323323    Location: string;
    324     Module: TModule;
     324    Module: TSourceModule;
    325325    Exported: Boolean;
    326326  end;
     
    330330
    331331  TUsedModuleList = class(TListUsedModule)
    332     ParentModule: TModule;
    333   end;
    334 
    335   { TModule }
    336 
    337   TModule = class
     332    ParentModule: TSourceModule;
     333  end;
     334
     335  { TSourceModule }
     336
     337  TSourceModule = class
    338338  public
    339339    ParentProgram: TProgram;
     
    342342    UsedModules: TUsedModuleList;
    343343    Body: TCommonBlock;
     344    Internal: Boolean;
    344345    function SearchVariable(Name: string; Outside: Boolean): TVariable; virtual;
    345346    function SearchConstant(Name: string; Outside: Boolean): TConstant; virtual;
     
    352353  { TModuleProgram }
    353354
    354   TModuleProgram = class(TModule)
     355  TModuleProgram = class(TSourceModule)
    355356    constructor Create;
    356357    destructor Destroy; override;
     
    359360  { TModuleUnit }
    360361
    361   TModuleUnit = class(TModule)
     362  TModuleUnit = class(TSourceModule)
    362363    InititializeSection: TCommonBlock;
    363364    FinalalizeSection: TCommonBlock;
     
    366367  end;
    367368
    368   TModulePackage = class(TModule)
    369 
    370   end;
    371 
    372   TModuleLibrary = class(TModule)
     369  TModulePackage = class(TSourceModule)
     370
     371  end;
     372
     373  TModuleLibrary = class(TSourceModule)
    373374  end;
    374375
     
    379380
    380381  TModuleList = class(TListModule)
    381     function Search(Name: string): TModule;
     382    function Search(Name: string): TSourceModule;
    382383  end;
    383384
     
    387388    Device: TDevice;
    388389    Modules: TModuleList;
    389     MainModule: TModule;
     390    MainModule: TSourceModule;
    390391    procedure Clear;
    391392    constructor Create;
     
    470471end;
    471472
    472 { TModule }
    473 
    474 constructor TModule.Create;
     473{ TSourceModule }
     474
     475constructor TSourceModule.Create;
    475476begin
    476477  inherited;
     
    481482end;
    482483
    483 destructor TModule.Destroy;
     484destructor TSourceModule.Destroy;
    484485begin
    485486  Body.Free;
     
    790791{ TModuleList }
    791792
    792 function TModuleList.Search(Name: string): TModule;
     793function TModuleList.Search(Name: string): TSourceModule;
    793794var
    794795  I: Integer;
    795796begin
    796797  I := 0;
    797   while (I < Count) and (LowerCase(TModule(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
    798   if I < Count then Result := TModule(Items[I])
     798  while (I < Count) and (LowerCase(TSourceModule(Items[I]).Name) <> LowerCase(Name)) do Inc(I);
     799  if I < Count then Result := TSourceModule(Items[I])
    799800    else Result := nil;
    800801end;
     
    802803{ TModuleProgram }
    803804
    804 function TModule.SearchVariable(Name: string; Outside: Boolean): TVariable;
     805function TSourceModule.SearchVariable(Name: string; Outside: Boolean): TVariable;
    805806var
    806807  I: Integer;
     
    817818end;
    818819
    819 function TModule.SearchConstant(Name: string; Outside: Boolean): TConstant;
    820 begin
    821 
    822 end;
    823 
    824 function TModule.SearchType(AName: string; Outside: Boolean): TType;
     820function TSourceModule.SearchConstant(Name: string; Outside: Boolean): TConstant;
     821begin
     822
     823end;
     824
     825function TSourceModule.SearchType(AName: string; Outside: Boolean): TType;
    825826var
    826827  I: Integer;
     
    840841end;
    841842
    842 function TModule.SearchFunction(Name: string; Outside: Boolean): TFunction;
     843function TSourceModule.SearchFunction(Name: string; Outside: Boolean): TFunction;
    843844var
    844845  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.