Ignore:
Timestamp:
Oct 14, 2010, 2:30:40 PM (14 years ago)
Author:
george
Message:
  • Added: Separated dockable windows.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Syntetizer/USyntetizer.pas

    r33 r61  
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, Contnrs;
    99
    1010type
     
    2929
    3030  TBeginEnd = class(TCommand)
    31     Commands: TList; // TList<ICommand>
     31    Commands: TObjectList; // TObjectList<ICommand>
    3232    LastEnd: Boolean;
    3333    procedure Syntetize(Syntetizer: TSyntetizer); override;
     
    4343
    4444  TVariableSection = class(TInterfacedObject, ISyntetizable)
    45     Variables: TList; // TList<TVariableDeclaration>
     45    Variables: TObjectList; // TObjectList<TVariableDeclaration>
    4646    procedure Syntetize(Syntetizer: TSyntetizer);
    4747    constructor Create;
     
    5151  TProcedure = class(TInterfacedObject, ISyntetizable)
    5252    Name: string;
    53     Parameters: TList;
     53    Parameters: TObjectList;
    5454    Code: TBeginEnd;
    5555    constructor Create;
     
    5959
    6060  TProcedureList = class(TInterfacedObject, ISyntetizable)
    61     Procedures: TList; // TList<TProcedure>
     61    Procedures: TObjectList; // TObjectList<TProcedure>
    6262    procedure Syntetize(Syntetizer: TSyntetizer);
    6363    constructor Create;
     
    7676  TProcedureCall = class(TCommand)
    7777    Name: string;
    78     Parameters: TList; // TList<TProcedureParameter>
     78    Parameters: TObjectList; // TObjectList<TProcedureParameter>
    7979    constructor Create;
    8080    destructor Destroy; override;
     
    8484  TProgram = class(TInterfacedObject, ISyntetizable)
    8585    Name: string;
    86     Code: TBeginend;
    87     CompilerDirectives: TList; // TList<TCompilerDirective>
     86    Code: TBeginEnd;
     87    CompilerDirectives: TObjectList; // TList<TCompilerDirective>
    8888    Procedures: TProcedureList; // TList<TProcedure>
    8989    Variables: TVariableSection;
     
    154154constructor TProgram.Create;
    155155begin
    156   CompilerDirectives := TList.Create;
     156  CompilerDirectives := TObjectList.Create;
    157157  Variables := TVariableSection.Create;
    158158  Procedures := TProcedureList.Create;
     
    162162
    163163destructor TProgram.Destroy;
    164 var
    165   I: Integer;
    166164begin
    167165  Procedures.Destroy;
    168166  Variables.Destroy;
    169   for I := 0 to CompilerDirectives.Count - 1 do
    170     TCompilerDirective(CompilerDirectives[I]).Destroy;
    171167  Code.Destroy;
     168  CompilerDirectives.Destroy;
    172169  inherited Destroy;
    173170end;
     
    192189constructor TBeginEnd.Create;
    193190begin
    194   Commands := TList.Create;
     191  Commands := TObjectList.Create;
    195192end;
    196193
    197194destructor TBeginEnd.Destroy;
    198 var
    199   I: Integer;
    200 begin
    201   for I := 0 to Commands.Count - 1 do
    202     TCommand(Commands[I]).Destroy;
     195begin
    203196  Commands.Destroy;
    204197  inherited Destroy;
     
    209202constructor TProcedureCall.Create;
    210203begin
    211   Parameters := TList.Create;
     204  Parameters := TObjectList.Create;
    212205end;
    213206
    214207destructor TProcedureCall.Destroy;
    215 var
    216   I: Integer;
    217 begin
    218   for I := 0 to Parameters.Count - 1 do
    219     TProcedureParameter(Parameters[I]).Destroy;
     208begin
    220209  Parameters.Destroy;
    221210  inherited Destroy;
     
    272261constructor TVariableSection.Create;
    273262begin
    274   Variables := TList.Create;
     263  Variables := TObjectList.Create;
    275264end;
    276265
    277266destructor TVariableSection.Destroy;
    278 var
    279   I: Integer;
    280 begin
    281   for I := 0 to Variables.Count - 1 do
    282     TVariableDeclaration(Variables[I]).Destroy;
     267begin
    283268  Variables.Destroy;
    284269  inherited Destroy;
     
    289274constructor TProcedure.Create;
    290275begin
    291   Parameters := TList.Create;
     276  Parameters := TObjectList.Create;
    292277  Code := TBeginEnd.Create;
    293278end;
    294279
    295280destructor TProcedure.Destroy;
    296 var
    297   I: Integer;
    298281begin
    299282  Code.Destroy;
    300   //for I := 0 to Parameters.Count - 1 do
    301   //  TParameter(Parameters[I]).Destroy;
    302283  Parameters.Destroy;
    303284  inherited Destroy;
     
    309290  ParameterString: string;
    310291begin
     292  ParameterString := '';
    311293  with Syntetizer do begin
    312294    for I := 0 to Parameters.Count - 1 do
     
    335317constructor TProcedureList.Create;
    336318begin
    337   Procedures := TList.Create;
     319  Procedures := TObjectList.Create;
    338320end;
    339321
    340322destructor TProcedureList.Destroy;
    341 var
    342   I: Integer;
    343 begin
    344   for I := 0 to Procedures.Count - 1 do
    345     TProcedure(Procedures[I]).Destroy;
     323begin
    346324  Procedures.Destroy;
    347325  inherited Destroy;
Note: See TracChangeset for help on using the changeset viewer.