public override object VisitIf_return_break_continue(FaParser.If_return_break_continueContext context) { int nExpressions = context.expression().Length; object result = null; bool thrown = false; for (int i = 0; i < nExpressions; i++) { object valueExp = VisitExpression(context.expression(i)); if (getType(valueExp) == 0) { if ((bool)valueExp) { result = Visit(context.body_return_break_continue(i)); thrown = true; break; } } else { Debug.LogError("La expresión a evaluar debe ser booleana"); // Console.WriteLine("La expresión a evaluar debe ser booleana"); MyConsole.main.AppendText("La expresión a evaluar debe ser booleana"); break; } } if (context.body_return_break_continue().Length > nExpressions && !thrown) { result = Visit(context.body_return_break_continue(context.body_return_break_continue().Length - 1)); } // Console.WriteLine("SE OBTIENE PARA ifbrc directo: "+result); return(result); }
/// <summary> /// Visit a parse tree produced by <see cref="FaParser.if_return_break_continue"/>. /// <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 VisitIf_return_break_continue([NotNull] FaParser.If_return_break_continueContext context) { return(VisitChildren(context)); }