Ejemplo n.º 1
0
    public void EvalCode(string code)
    {
        // Debug.Log("Solicitado:  "+code);
        CustomErrorListener errorListener     = new CustomErrorListener(false);
        AntlrInputStream    inputStream       = new AntlrInputStream(code);
        FaLexer             FaLexer           = new FaLexer(inputStream);
        CommonTokenStream   commonTokenStream = new CommonTokenStream(FaLexer);
        FaParser            parser            = new FaParser(commonTokenStream);

        parser.AddErrorListener(errorListener);

        FaParser.PrincipalContext context = parser.principal();
        MyVisitor loader = new MyVisitor();

        loader.Visit(context);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="FaParser.principal"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitPrincipal([NotNull] FaParser.PrincipalContext context)
 {
     return(VisitChildren(context));
 }
Ejemplo n.º 3
0
 public override object VisitPrincipal(FaParser.PrincipalContext context)
 {
     queue.AddLast(memory);
     return(VisitChildren(context));
 }