Exemplo n.º 1
0
        public override bool VisitVar_stmt([NotNull] GrammarParser.Var_stmtContext context)
        {
            Console.WriteLine("Var Statement here " + context.GetText());


            //Write each child to pythonScript.txt. Each child can be translated if necessary.
            //Should be added to the symbol table or something?


            /* Just some experimenting with code generation
             * for (int i = 0; i < context.children.Count; i++)
             * {
             *  using (StreamWriter sw = File.AppendText(path))
             *  {
             *      sw.Write(context.GetChild(i).GetText());
             *  }
             * }
             */

            return(base.VisitVar_stmt(context));
        }
 /// <summary>
 /// Enter a parse tree produced by <see cref="GrammarParser.var_stmt"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterVar_stmt([NotNull] GrammarParser.Var_stmtContext context)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="GrammarParser.var_stmt"/>.
 /// <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 VisitVar_stmt([NotNull] GrammarParser.Var_stmtContext context)
 {
     return(VisitChildren(context));
 }