예제 #1
0
        public override object VisitTermAddlopExprAST([NotNull] ParserProgra.TermAddlopExprASTContext context)
        {
            printTab(cont);
            txtBoxTreeVisitor.AppendText("expr: \n");
            cont++;
            if (context.SUB() != null)
            {
                printTab(cont);
                txtBoxTreeVisitor.AppendText("TokenSub\n");
            }

            string tipo1 = (string)Visit(context.term(0));

            printTab(cont);
            if (tipo1 != null)
            {
                txtBoxTreeVisitor.AppendText("Tipo => " + tipo1 + "\n");
            }
            for (int i = 1; i < context.addlop().Count; i++)
            {
                Visit(context.addlop(i));
                Visit(context.term(i + 1));
                printTab(cont);
                string tipo = (string)Visit(context.term(i));
                if (tipo != null)
                {
                    txtBoxTreeVisitor.AppendText("Tipo => " + tipo + "\n");
                }
            }
            cont--;
            return(null);
        }
예제 #2
0
 public override object VisitTermAddlopExprAST([NotNull] ParserProgra.TermAddlopExprASTContext context)
 {
     printTab(cont);
     txtBoxTreeVisitor.AppendText("expr: \n");
     cont++;
     if (context.SUB() != null)
     {
         printTab(cont);
         txtBoxTreeVisitor.AppendText("TokenSub\n");
     }
     Visit(context.term(0));
     for (int i = 0; i < context.addlop().Count; i++)
     {
         Visit(context.addlop(i));
         Visit(context.term(i + 1));
     }
     cont--;
     return(null);
 }
 /// <summary>
 /// Exit a parse tree produced by <see cref="ParserProgra.termAddlopExprAST"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitTermAddlopExprAST([NotNull] ParserProgra.TermAddlopExprASTContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by <see cref="ParserProgra.termAddlopExprAST"/>.
 /// <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 VisitTermAddlopExprAST([NotNull] ParserProgra.TermAddlopExprASTContext context)
 {
     return(VisitChildren(context));
 }