Changeset 31 for branches/Analyzátor gramatiky/UProgram.pas
- Timestamp:
- Nov 11, 2009, 1:43:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Analyzátor gramatiky/UProgram.pas
r30 r31 72 72 if not Assigned(SelectedProgramItem.Items[CharIndex]) then 73 73 SelectedProgramItem.Items[CharIndex] := TProgramItem.Create; 74 SelectedProgramItem := TProgramItem(SelectedProgramItem.Items[CharIndex]);74 SelectedProgramItem := SelectedProgramItem.Items[CharIndex]; 75 75 (* end else begin 76 76 SelectedProgramItem.Items.Count := SelectedProgramItem.Items.Count + 1; … … 109 109 end; 110 110 111 for I := 1 to Length(Text) do 112 begin 113 if (Text[I] <> #13) and (Text[I] <> #10) then 114 begin 111 for I := 1 to Length(Text) do begin 112 if (Text[I] <> #13) and (Text[I] <> #10) then begin 115 113 UseIndex := Path.Items[Path.Items.Count - 1].ItemIndex; 116 114 UseCharIndex := Path.Items[Path.Items.Count - 1].CharIndex; … … 208 206 I: Integer; 209 207 begin 210 for I := 0 to Items.Count - 1 do with Items[I] do begin 208 for I := 0 to Items.Count - 1 do 209 with Items[I] do begin 211 210 if ItemType = itNonterminal then begin 212 211 if Rule.Name = ARule.Name then begin … … 235 234 begin 236 235 for I := 0 to Items.Count - 1 do 237 with TProgramItem(Items[I])do begin236 with Items[I] do begin 238 237 if ItemType = itNonterminal then Delete; 239 238 end; … … 246 245 I := 0; 247 246 while I < Items.Count do 248 with TProgramItem(Items[I])do begin247 with Items[I] do begin 249 248 if ItemType = itNonterminal then begin 250 249 if Items.Count = 0 then begin … … 260 259 procedure TProgramItem.DeleteItem(Index: Integer); 261 260 begin 262 if TProgramItem(Items[Index]).ItemType = itNonterminal then263 TProgramItem(Items[Index]).Delete;261 if Items[Index].ItemType = itNonterminal then 262 Items[Index].Delete; 264 263 Items.Delete(Index); 265 264 end; … … 314 313 begin 315 314 Result := ''; 316 for I := 0 to Items.Count - 1 do with Items[I] do begin 315 for I := 0 to Items.Count - 1 do 316 with Items[I] do begin 317 317 if ItemType = itTerminal then Result := Result + Value 318 318 else Result := Result + MergeToTerminal;
Note:
See TracChangeset
for help on using the changeset viewer.