Esempio n. 1
0
        public override IQueryElement VisitWhere_operation([NotNull] QueryGrammarParser.Where_operationContext context)
        {
            IQueryElement leftValueTree = Visit(context.left);

            if (context.where_operator().is_null() != null)
            {
                OperationIsNull isNullTree = new OperationIsNull();
                isNullTree.Add(leftValueTree);
                return(isNullTree);
            }
            else if (context.where_operator().is_not_null() != null)
            {
                OperationIsNotNull isNotNullTree = new OperationIsNotNull();
                isNotNullTree.Add(leftValueTree);
                return(isNotNullTree);
            }

            OperationComperision comperasionTree = new OperationComperision();

            LeftOperand left = new LeftOperand();

            left.Add(leftValueTree);
            comperasionTree.Add(left);

            IQueryElement operatorTree = Visit(context.where_operator().comparison_operator());

            comperasionTree.Add(operatorTree);

            RightOperand  right          = new RightOperand();
            IQueryElement rightValueTree = Visit(context.right);

            right.Add(rightValueTree);
            comperasionTree.Add(right);

            return(comperasionTree);
        }