Exemple #1
0
 /// <summary>
 /// Installs this scenario's markup. This will inflate the list of givens, elements and available
 /// derivatives.
 /// </summary>
 /// <param name="markup">The calculation markup to be used in this scenario.</param>
 public void InstallMarkup(string markup)
 {
     parseContext.Scenario = this;
     Markup  = markup;
     input   = new AntlrInputStream(markup);
     lexer   = new ShapPangLexer(input);
     tokens  = new CommonTokenStream(lexer);
     parser  = new ShapPangParser(tokens);
     visitor = new ShapDiscoveryVisitor(parseContext);
     parser.AddErrorListener(new ShapPangErrorListener());
     ShapPangParser.CompileUnitContext context = parser.compileUnit();
     if (parser.NumberOfSyntaxErrors != 0)
     {
         throw new Exception("Parsing failed");
     }
     visitor.VisitCompileUnit(context);
 }
Exemple #2
0
 public override object VisitCompileUnit(ShapPangParser.CompileUnitContext context)
 {
     return(base.VisitCompileUnit(context));
 }