Beispiel #1
0
        public override int VisitDowhile([NotNull] TemplateParser.DowhileContext context)
        {
            PushStack();
            try
            {
                while (true)
                {
                    var codes = context.code();
                    for (int i = 0; i < codes.Length; i++)
                    {
                        codes[i].Accept(this);
                    }

                    var exprValue = ExecExpr(context.condition);
                    if (exprValue.type == AtomType.BOOL && (bool)exprValue.value)
                    {
                        //continue;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            finally
            {
                PopStack();
            }
            return(0);
        }
Beispiel #2
0
 public override int VisitDowhile([NotNull] TemplateParser.DowhileContext context)
 {
     MakeClassificationSpan(context.keywordA, classificater.ClassificationKeyword);
     MakeClassificationSpan(context.keywordB, classificater.ClassificationKeyword);
     MakeBracePair(context.PARENTHESES_L(), context.PARENTHESES_R());
     MakeBracePair(context.BRACE_L(), context.BRACE_R());
     return(base.VisitDowhile(context));
 }
Beispiel #3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="TemplateParser.dowhile"/>.
 /// <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 VisitDowhile([NotNull] TemplateParser.DowhileContext context)
 {
     return(VisitChildren(context));
 }
Beispiel #4
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="TemplateParser.dowhile"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitDowhile([NotNull] TemplateParser.DowhileContext context)
 {
 }