Ignore:
Timestamp:
Nov 29, 2017, 5:09:16 PM (7 years ago)
Author:
chronos
Message:
  • Added: Top start rule can be selected for grammer. This rule is used for parser as initial rule.
Location:
branches/generator/Forms
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormMain.lfm

    r119 r124  
    8080        Action = ASaveAs
    8181      end
     82      object MenuItem12: TMenuItem
     83        Action = AGrammerSettings
     84      end
    8285      object MenuItem6: TMenuItem
    8386        Caption = '-'
     
    143146      OnExecute = ANewExecute
    144147    end
     148    object AGrammerSettings: TAction
     149      Caption = 'Settings'
     150      OnExecute = AGrammerSettingsExecute
     151    end
    145152  end
    146153  object OpenDialog1: TOpenDialog
  • branches/generator/Forms/UFormMain.pas

    r123 r124  
    1515  TFormMain = class(TForm)
    1616    ABuildCompiler: TAction;
     17    AGrammerSettings: TAction;
    1718    ANew: TAction;
    1819    ASave: TAction;
     
    2829    MenuItem10: TMenuItem;
    2930    MenuItem11: TMenuItem;
     31    MenuItem12: TMenuItem;
    3032    MenuItem2: TMenuItem;
    3133    MenuItem3: TMenuItem;
     
    4345    procedure ABuildCompilerExecute(Sender: TObject);
    4446    procedure AExitExecute(Sender: TObject);
     47    procedure AGrammerSettingsExecute(Sender: TObject);
    4548    procedure ANewExecute(Sender: TObject);
    4649    procedure AOpenExecute(Sender: TObject);
     
    6669
    6770uses
    68   UFormRules, UCore;
     71  UFormRules, UCore, UFormGrammer;
    6972
    7073{ TFormMain }
     
    123126end;
    124127
     128procedure TFormMain.AGrammerSettingsExecute(Sender: TObject);
     129var
     130  FormGrammer: TFormGrammer;
     131begin
     132  FormGrammer := TFormGrammer.Create(nil);
     133  FormGrammer.LoadData(Core.Grammer);
     134  if FormGrammer.ShowModal = mrOk then begin
     135    FormGrammer.SaveData(Core.Grammer);
     136  end;
     137  FreeAndNil(FormGrammer);
     138end;
     139
    125140procedure TFormMain.ANewExecute(Sender: TObject);
    126141begin
  • branches/generator/Forms/UFormRuleItem.pas

    r123 r124  
    100100    ritNonTerminal: ListBox1.SetFocus;
    101101    ritSubItems: TFormRuleItems(FormRuleItems).ListView1.SetFocus;
     102    ritTerminalRange: EditTerminalFrom.SetFocus;
    102103  end;
    103104end;
Note: See TracChangeset for help on using the changeset viewer.