Ignore:
Timestamp:
Jun 4, 2024, 12:22:49 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyzer.pas

    r74 r75  
    1 unit UAnalyzer;
    2 
    3 {$MODE Delphi}
    4 {$MACRO ON}
     1unit Analyzer;
    52
    63interface
    74
    85uses
    9   SysUtils, Variants, Classes, Contnrs,
    10   Dialogs, USourceCodePascal, FileUtil, SpecializedList;
     6  SysUtils, Variants, Classes, Dialogs, SourceCodePascal, FileUtil,
     7  Generics.Collections;
    118
    129type
     
    5451    CodePosition: TPoint;
    5552    SourceCode2: string;
    56     Tokens: TObjectList; // TObjectList<TToken>
     53    Tokens: TObjectList<TToken>;
    5754    TokenIndex: Integer;
    5855    constructor Create;
     
    8380  end;
    8481
    85   { TListAnalyzer }
    86 
    87   TListAnalyzer = class(TListObject)
     82  { TAnalyzers }
     83
     84  TAnalyzers = class(TObjectList<TAnalyzer>)
    8885    function SearchBySysName(Name: string): TAnalyzer;
    8986    procedure LoadToStrings(Strings: TStrings);
     
    9390  SExpectedButFound = 'Expected "%s" but "%s" found.';
    9491
     92
    9593implementation
    9694
    97 { TListAnalyzer }
    98 
    99 function TListAnalyzer.SearchBySysName(Name: string): TAnalyzer;
     95{ TAnalyzers }
     96
     97function TAnalyzers.SearchBySysName(Name: string): TAnalyzer;
    10098var
    10199  I: Integer;
     
    107105end;
    108106
    109 procedure TListAnalyzer.LoadToStrings(Strings: TStrings);
     107procedure TAnalyzers.LoadToStrings(Strings: TStrings);
    110108var
    111109  I: Integer;
     
    154152constructor TAnalyzer.Create;
    155153begin
    156   Tokens := TObjectList.Create;
     154  Tokens := TObjectList<TToken>.Create;
    157155  {$IFDEF windows}
    158156  LineEndingChar := LineEnding[1];
     
    164162destructor TAnalyzer.Destroy;
    165163begin
    166   Tokens.Free;
    167   inherited Destroy;
     164  FreeAndNil(Tokens);
     165  inherited;
    168166end;
    169167
Note: See TracChangeset for help on using the changeset viewer.