Exemplo n.º 1
0
        /// <summary>
        /// Visit a parse tree produced by <see cref="CodeQueryParser.ConstantBoolean" />.
        /// <para>
        /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)" />
        /// on <paramref name="context" />.
        /// </para>
        /// </summary>
        public override Object VisitConstantBoolean(CodeQueryParser.ConstantBooleanContext context)
        {
            switch (context.BOOLEAN().GetText())
            {
            case "false":
                return(TreeFactory.CreateBoolean(false));

            case "true":
                return(TreeFactory.CreateBoolean(true));

            default:
                throw new NotSupportedException("Not supported boolean value!");
            }
        }
Exemplo n.º 2
0
        public override CodeQueryVisitor VisitConstantBoolean(CodeQueryParser.ConstantBooleanContext context)
        {
            switch (context.BOOLEAN().GetText())
            {
            case "false":
                _constants.Push(false);
                break;

            case "true":
                _constants.Push(true);
                break;

            default:
                throw new NotSupportedException("Not supported boolean value!");
            }

            return(base.VisitConstantBoolean(context));
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="CodeQueryParser.ConstantBoolean"/>.
 /// <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 VisitConstantBoolean([NotNull] CodeQueryParser.ConstantBooleanContext context)
 {
     return(VisitChildren(context));
 }
 /// <summary>
 /// Exit a parse tree produced by <see cref="CodeQueryParser.ConstantBoolean"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitConstantBoolean([NotNull] CodeQueryParser.ConstantBooleanContext context)
 {
 }