Ignore:
Timestamp:
Dec 26, 2017, 6:59:40 PM (7 years ago)
Author:
chronos
Message:
  • Added: Support for whitespaces in And rule.
  • Added: Terminals can be specified as escaped strings with slash.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormGrammer.pas

    r129 r136  
    1717    ButtonOk: TButton;
    1818    ComboBoxStartRule: TComboBox;
     19    ComboBoxWhiteSpaceRule: TComboBox;
    1920    Label1: TLabel;
     21    Label2: TLabel;
    2022    procedure FormShow(Sender: TObject);
    2123  private
     
    4951  end;
    5052  ComboBoxStartRule.Sorted := True;
     53
     54  ComboBoxWhiteSpaceRule.Items.Clear;
     55  for Rule in Grammer.Rules do begin
     56    ComboBoxWhiteSpaceRule.Items.AddObject(Rule.Name, Rule);
     57  end;
     58  ComboBoxWhiteSpaceRule.Sorted := True;
    5159end;
    5260
     
    5866    ComboBoxStartRule.ItemIndex := ComboBoxStartRule.Items.IndexOfObject(Grammer.TopRule);
    5967  end else ComboBoxStartRule.ItemIndex := -1;
     68  if Assigned(Grammer.WhiteSpaceRule) then begin
     69    ComboBoxWhiteSpaceRule.ItemIndex := ComboBoxWhiteSpaceRule.Items.IndexOfObject(Grammer.WhiteSpaceRule);
     70  end else ComboBoxWhiteSpaceRule.ItemIndex := -1;
    6071end;
    6172
     
    6677    Grammer.TopRule := TRule(ComboBoxStartRule.Items.Objects[ComboBoxStartRule.ItemIndex])
    6778    else Grammer.TopRule := nil;
     79  if ComboBoxWhiteSpaceRule.ItemIndex <> -1 then
     80    Grammer.WhiteSpaceRule := TRule(ComboBoxWhiteSpaceRule.Items.Objects[ComboBoxWhiteSpaceRule.ItemIndex])
     81    else Grammer.WhiteSpaceRule := nil;
    6882end;
    6983
Note: See TracChangeset for help on using the changeset viewer.