public override object VisitParCommand([NotNull] OALParser.ParCommandContext context) { stackEXEScope.Push(new EXEScopeParallel()); for (int i = 1; i < context.ChildCount; i++) { Console.WriteLine(i + " -> " + context.GetChild(i).GetText() + " --- " + context.GetChild(i).GetType().Name); if (context.GetChild(i).GetText().Equals("thread")) { stackEXEScope.Push(new EXEScope()); } else if (context.GetChild(i).GetType().Name.Contains("LineContext")) { Visit(context.GetChild(i)); } else if (context.GetChild(i).GetText().Equals("end thread;")) { EXEScope temp = stackEXEScope.Pop(); ((EXEScopeParallel)stackEXEScope.Peek()).AddThread(temp); } else if (context.GetChild(i).GetText().Equals("end par;")) { EXEScope temp = stackEXEScope.Pop(); stackEXEScope.Peek().AddCommand(temp); } } return(null); //return base.VisitParCommand(context); }
/// <summary> /// Visit a parse tree produced by <see cref="OALParser.parCommand"/>. /// <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 VisitParCommand([NotNull] OALParser.ParCommandContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="OALParser.parCommand"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitParCommand([NotNull] OALParser.ParCommandContext context) { }