Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 /// <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)
 {
 }