예제 #1
0
 public LanguageCompiler(GrammarData data)
 {
     Data = data;
       Grammar = data.Grammar;
       Parser = new Parser(Data);
       Scanner = new Scanner(Data);
 }
예제 #2
0
 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
 }
예제 #3
0
 public virtual void OnActionSelected(Parser parser, Token input, ActionRecord action)
 {
 }
예제 #4
0
 public virtual ActionRecord OnActionConflict(Parser parser, Token input, ActionRecord action)
 {
     return action;
 }
예제 #5
0
 public override void OnActionSelected(Parser parser, Token input, ActionRecord action)
 {
     Console.WriteLine ("OnActionSelected: {0} / {1}", input, action);
 }
예제 #6
0
 public override ActionRecord OnActionConflict(Parser parser, Token input, ActionRecord action)
 {
     throw new Exception (String.Format ("Action conflict: {0} {1}", ((AstNode) input).Location, action));
 }