Ignore:
Timestamp:
Jul 31, 2012, 4:06:07 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Code related to pascal language in compiler moved to module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UAnalyzer.pas

    r68 r70  
    8383  end;
    8484
    85   // TListAnalyzer = TGObjectList<Integer, TAnalyzer>
     85  { TListAnalyzer }
     86
    8687  TListAnalyzer = class(TListObject)
     88    function SearchBySysName(Name: string): TAnalyzer;
     89    procedure LoadToStrings(Strings: TStrings);
    8790  end;
    8891
     
    9194
    9295implementation
     96
     97{ TListAnalyzer }
     98
     99function TListAnalyzer.SearchBySysName(Name: string): TAnalyzer;
     100var
     101  I: Integer;
     102begin
     103  I := 0;
     104  while (I < Count) and (TAnalyzer(Items[I]).SysName <> Name) do Inc(I);
     105  if I < Count then Result := TAnalyzer(Items[I])
     106    else Result := nil;
     107end;
     108
     109procedure TListAnalyzer.LoadToStrings(Strings: TStrings);
     110var
     111  I: Integer;
     112begin
     113  try
     114    Strings.BeginUpdate;
     115    Strings.Clear;
     116    for I := 0 to Count - 1 do
     117      Strings.AddObject(TAnalyzer(Items[I]).Name, Items[I]);
     118  finally
     119    Strings.EndUpdate;
     120  end;
     121end;
    93122
    94123{ TAnalyzer }
Note: See TracChangeset for help on using the changeset viewer.