void IVisitor.VisitAfter(BinaryOpPredicate predicate)
 {
     this.ParentExists(predicate);
 }
 void IVisitor.VisitBefore(BinaryOpPredicate predicate)
 {
     this.ParentExists(predicate);
 }
        public override void ExitBinaryOpPredicate(MiniSqlParserParser.BinaryOpPredicateContext context)
        {
            var right    = (Expr)_stack.Pop();
            var comments = this.GetComments(context.op);
            var left     = (Expr)_stack.Pop();

            var opType           = context.op.Type;
            PredicateOperator op = PredicateOperator.Equal;

            if (opType == MiniSqlParserLexer.ASSIGN)
            {
                op = PredicateOperator.Equal;
            }
            else if (opType == MiniSqlParserLexer.NOT_EQ2)
            {
                op = PredicateOperator.NotEqual;
            }
            else if (opType == MiniSqlParserLexer.LT)
            {
                op = PredicateOperator.Less;
            }
            else if (opType == MiniSqlParserLexer.LT_EQ)
            {
                op = PredicateOperator.LessOrEqual;
            }
            else if (opType == MiniSqlParserLexer.GT)
            {
                op = PredicateOperator.Greater;
            }
            else if (opType == MiniSqlParserLexer.GT_EQ)
            {
                op = PredicateOperator.GreaterOrEqual;
            }
            else if (opType == MiniSqlParserLexer.EQ)
            {
                op = PredicateOperator.Equal2;
            }
            else if (opType == MiniSqlParserLexer.NOT_EQ1)
            {
                op = PredicateOperator.NotEqual2;
            }
            else if (opType == MiniSqlParserLexer.AT_LT)
            {
                op = PredicateOperator.ContainsJsonValueL;
            }
            else if (opType == MiniSqlParserLexer.AT_GT)
            {
                op = PredicateOperator.ContainsJsonValueR;
            }
            else if (opType == MiniSqlParserLexer.QRY_PIPE)
            {
                op = PredicateOperator.ExistsJsonValue2;
            }
            else if (opType == MiniSqlParserLexer.QRY_AMP)
            {
                op = PredicateOperator.ExistsJsonValue3;
            }
            else
            {
                throw new CannotBuildASTException("Undifined PredicateOperator is used");
            }

            var node = new BinaryOpPredicate(left, op, right, comments);

            _stack.Push(node);
        }