Ignore:
Timestamp:
Nov 11, 2009, 1:43:47 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Chyby v inicializaci objektů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Analyzátor gramatiky/UProgram.pas

    r30 r31  
    7272        if not Assigned(SelectedProgramItem.Items[CharIndex]) then
    7373          SelectedProgramItem.Items[CharIndex] := TProgramItem.Create;
    74         SelectedProgramItem := TProgramItem(SelectedProgramItem.Items[CharIndex]);
     74        SelectedProgramItem := SelectedProgramItem.Items[CharIndex];
    7575(*      end else begin
    7676        SelectedProgramItem.Items.Count := SelectedProgramItem.Items.Count + 1;
     
    109109  end;
    110110
    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
    115113      UseIndex := Path.Items[Path.Items.Count - 1].ItemIndex;
    116114      UseCharIndex := Path.Items[Path.Items.Count - 1].CharIndex;
     
    208206  I: Integer;
    209207begin
    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
    211210    if ItemType = itNonterminal then begin
    212211      if Rule.Name = ARule.Name then begin
     
    235234begin
    236235  for I := 0 to Items.Count - 1 do
    237   with TProgramItem(Items[I]) do begin
     236  with Items[I] do begin
    238237    if ItemType = itNonterminal then Delete;
    239238  end;
     
    246245  I := 0;
    247246  while I < Items.Count do
    248   with TProgramItem(Items[I]) do begin
     247  with Items[I] do begin
    249248    if ItemType = itNonterminal then begin
    250249      if Items.Count = 0 then begin
     
    260259procedure TProgramItem.DeleteItem(Index: Integer);
    261260begin
    262   if TProgramItem(Items[Index]).ItemType = itNonterminal then
    263     TProgramItem(Items[Index]).Delete;
     261  if Items[Index].ItemType = itNonterminal then
     262    Items[Index].Delete;
    264263  Items.Delete(Index);
    265264end;
     
    314313begin
    315314  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
    317317    if ItemType = itTerminal then Result := Result + Value
    318318      else Result := Result + MergeToTerminal;
Note: See TracChangeset for help on using the changeset viewer.