Changeset 50 for branches/DelphiToC/Visual/USourceTree.pas
- Timestamp:
- Aug 9, 2010, 3:05:26 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Visual/USourceTree.pas
r48 r50 27 27 procedure AddNodeProgram(Node: TTreeNode; Code: TProgram); 28 28 procedure AddNodeWhileDo(Node: TTreeNode; WhileDo: TWhileDo); 29 procedure AddNodeForToDo(Node: TTreeNode; ForToDo: TForToDo); 29 30 procedure AddNodeCommand(Node: TTreeNode; Command: TCommand); 30 31 procedure AddNodeExpression(Node: TTreeNode; Expression: TExpression); … … 58 59 I: Integer; 59 60 begin 60 NewNode := TreeView.Items.AddChild(Node, 'while -do');61 NewNode := TreeView.Items.AddChild(Node, 'while'); 61 62 NewNode2 := TreeView.Items.AddChild(NewNode, 'condition'); 62 63 AddNodeExpression(NewNode2, WhileDo.Condition); 63 NewNode2 := TreeView.Items.AddChild(NewNode, ' command');64 NewNode2 := TreeView.Items.AddChild(NewNode, 'do'); 64 65 AddNodeCommand(NewNode2, WhileDo.Command); 66 end; 67 68 procedure TSourceTree.AddNodeForToDo(Node: TTreeNode; ForToDo: TForToDo); 69 var 70 NewNode: TTreeNode; 71 NewNode2: TTreeNode; 72 NewNode3: TTreeNode; 73 I: Integer; 74 begin 75 with ForToDo do begin 76 NewNode := TreeView.Items.AddChild(Node, 'for'); 77 NewNode2 := TreeView.Items.AddChild(NewNode, 'control'); 78 NewNode3 := TreeView.Items.AddChild(NewNode2, ControlVariable.Name); 79 NewNode2 := TreeView.Items.AddChild(NewNode, 'from'); 80 AddNodeExpression(NewNode2, Start); 81 NewNode2 := TreeView.Items.AddChild(NewNode, 'to'); 82 AddNodeExpression(NewNode2, Stop); 83 NewNode2 := TreeView.Items.AddChild(NewNode, 'do'); 84 AddNodeCommand(NewNode2, Command); 85 end; 65 86 end; 66 87 … … 101 122 begin 102 123 if Command is TBeginEnd then 103 AddNodeBeginEnd(Node, TBeginEnd(Command)); 124 AddNodeBeginEnd(Node, TBeginEnd(Command)) 125 else 104 126 if Command is TWhileDo then 105 AddNodeWhileDo(Node, TWhileDo(Command)); 127 AddNodeWhileDo(Node, TWhileDo(Command)) 128 else 106 129 if Command is TFunctionCall then 107 AddNodeMethodCall(Node, TFunctionCall(Command)); 130 AddNodeMethodCall(Node, TFunctionCall(Command)) 131 else 108 132 if Command is TIfThenElse then 109 AddNodeIfThenElse(Node, TIfThenElse(Command)); 133 AddNodeIfThenElse(Node, TIfThenElse(Command)) 134 else 135 if Command is TForToDo then 136 AddNodeForToDo(Node, TForToDo(Command)) 137 else 110 138 if Command is TAssignment then 111 139 AddNodeAssignment(Node, TAssignment(Command)); … … 172 200 NewNode := TreeView.Items.AddChild(Node, 'type'); 173 201 for I := 0 to Types.Count - 1 do 174 with TType(Types[I]) do begin 202 with TType(Types[I]) do 203 if not System then begin 175 204 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = '); 176 205 end; … … 186 215 begin 187 216 for I := 0 to Methods.Count - 1 do 188 with TFunction(Methods[I]) do begin 217 with TFunction(Methods[I]) do 218 if not System then begin 189 219 if HaveResult then 190 220 NewNode := TreeView.Items.AddChild(Node, 'function ' + Name)
Note:
See TracChangeset
for help on using the changeset viewer.