//###################### // CICLES //###################### public override object VisitWhile_regular(FaParser.While_regularContext context) { object valueExp = VisitExpression(context.expression()); int limit = 500; int cicles = 0; if (valueExp is bool) { while ((bool)valueExp) { object resp = Visit(context.body_break_continue()); if (resp is float) { if ((float)resp == (float)1.1) { break; } else { } } valueExp = VisitExpression(context.expression()); cicles++; if (cicles > limit) { break; } } } else { Debug.LogError("No es una expresion booleana para while"); // Console.WriteLine("No es una expresion booleana para while"); MyConsole.main.AppendText("No es una expresion booleana para while"); } return(null); }
/// <summary> /// Visit a parse tree produced by <see cref="FaParser.while_regular"/>. /// <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 VisitWhile_regular([NotNull] FaParser.While_regularContext context) { return(VisitChildren(context)); }