예제 #1
0
    public override object VisitExpressionContentContentOr(FaParser.ExpressionContentContentOrContext context)
    {
        object left   = Visit(context.expressionContent(0));
        object right  = Visit(context.expressionContent(1));
        object result = null;

        if (left is bool && right is bool)
        {
            result = (bool)left || (bool)right;
        }
        else
        {
            Debug.LogError("No se puede aplicar && a tipos no booleanos");
            // Console.WriteLine("No se puede aplicar && a tipos no booleanos");
            MyConsole.main.AppendText("No se puede aplicar && a tipos no booleanos");
        }

        return(result);
    }
예제 #2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>expressionContentContentOr</c>
 /// labeled alternative in <see cref="FaParser.expressionContent"/>.
 /// <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 VisitExpressionContentContentOr([NotNull] FaParser.ExpressionContentContentOrContext context)
 {
     return(VisitChildren(context));
 }