/// <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!"); } }
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)); }