public LanguageCompiler(GrammarData data) { Data = data; Grammar = data.Grammar; Parser = new Parser(Data); Scanner = new Scanner(Data); }
public LanguageCompiler(Grammar grammar) { Grammar = grammar; #if !SILVERLIGHT Stopwatch sw = new Stopwatch(); sw.Start(); #endif GrammarDataBuilder bld = new GrammarDataBuilder(grammar); bld.Build(); Data = bld.Data; Parser = new Parser(Data); Scanner = new Scanner(Data); #if !SILVERLIGHT sw.Stop(); InitTime = sw.ElapsedMilliseconds; #endif }
public virtual void OnActionSelected(Parser parser, Token input, ActionRecord action) { }
public virtual ActionRecord OnActionConflict(Parser parser, Token input, ActionRecord action) { return action; }
public override void OnActionSelected(Parser parser, Token input, ActionRecord action) { Console.WriteLine ("OnActionSelected: {0} / {1}", input, action); }
public override ActionRecord OnActionConflict(Parser parser, Token input, ActionRecord action) { throw new Exception (String.Format ("Action conflict: {0} {1}", ((AstNode) input).Location, action)); }