Ignore:
Timestamp:
Aug 9, 2010, 10:22:30 AM (14 years ago)
Author:
george
Message:

Reworked tokenizer code with state machine instead of direct sequence analyze.
Parser classes with class methods rewrited back to single class TPaascalParser which inherit from TBasePascal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/Visual/USourceTree.pas

    r42 r44  
    2323    procedure AddNodeConstantList(Node: TTreeNode; Constants: TConstantList);
    2424    procedure AddNodeModule(Node: TTreeNode; Module: TModule);
     25    procedure AddNodeUses(Node: TTreeNode; UsedModuleList: TUsedModuleList);
    2526    procedure AddNodeProgram(Node: TTreeNode; Code: TProgram);
    2627    procedure AddNodeWhileDo(Node: TTreeNode; WhileDo: TWhileDo);
     
    207208  end;
    208209  NewNode := TreeView.Items.AddChild(Node, TypeName + ' ' + Module.Name);
    209   for I := 0 to Module.Constants.Count - 1 do begin
    210     AddNodeMethodList(NewNode, Module.Methods);
    211     AddNodeConstantList(NewNode, Module.Constants);
    212     AddNodeVariableList(NewNode, Module.Variables);
    213     AddNodeTypeList(NewNode, Module.Types);
    214     AddNodeBeginEnd(NewNode, Module.Code);
     210  AddNodeUses(NewNode, Module.UsedModules);
     211  AddNodeMethodList(NewNode, Module.Methods);
     212  AddNodeConstantList(NewNode, Module.Constants);
     213  AddNodeVariableList(NewNode, Module.Variables);
     214  AddNodeTypeList(NewNode, Module.Types);
     215  AddNodeBeginEnd(NewNode, Module.Code);
     216end;
     217
     218procedure TSourceTree.AddNodeUses(Node: TTreeNode;
     219  UsedModuleList: TUsedModuleList);
     220var
     221  NewNode: TTreeNode;
     222  I: Integer;
     223begin
     224  NewNode := TreeView.Items.AddChild(Node, 'uses');
     225  for I := 0 to UsedModuleList.Count - 1 do begin
     226    TreeView.Items.AddChild(NewNode, TUsedModule(UsedModuleList[I]).Name);
    215227  end;
    216228end;
Note: See TracChangeset for help on using the changeset viewer.