public override object VisitWhileCommand([NotNull] OALParser.WhileCommandContext context) { Visit(context.GetChild(2)); EXEScopeLoopWhile EXEScopeLoopWhile = new EXEScopeLoopWhile(stackEXEASTNode.Peek()); stackEXEASTNode.Clear(); stackEXEScope.Push(EXEScopeLoopWhile); for (int i = 4; i < context.ChildCount; i++) { if (context.GetChild(i).GetType().Name.Contains("LineContext")) { Visit(context.GetChild(i)); } else if (context.GetChild(i).GetText().Contains("end while;")) { EXEScope temp = stackEXEScope.Pop(); stackEXEScope.Peek().AddCommand(temp); } } return(null); //return base.VisitWhileCommand(context); }
/// <summary> /// Visit a parse tree produced by <see cref="OALParser.whileCommand"/>. /// <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 VisitWhileCommand([NotNull] OALParser.WhileCommandContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="OALParser.whileCommand"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitWhileCommand([NotNull] OALParser.WhileCommandContext context) { }