Exemplo n.º 1
0
        public override SqlExpression VisitAtom(PlSqlParser.AtomContext context)
        {
            var subquery = context.subquery();

            if (subquery != null && !subquery.IsEmpty)
            {
                return(Visit(subquery));
            }

            var constant = context.constant();

            if (constant != null && !constant.IsEmpty)
            {
                return(Visit(constant));
            }

            var bindVariable = context.bind_variable();

            if (bindVariable != null && !bindVariable.IsEmpty)
            {
                return(Visit(bindVariable));
            }

            var group = context.group();

            if (group != null && !group.IsEmpty)
            {
                return(Visit(group));
            }

            return(base.VisitAtom(context));
        }
Exemplo n.º 2
0
        /// <summary>
        /// atom :
        ///       table_element outer_join_sign
        ///     | bind_variable
        ///     | constant
        ///     | general_element
        ///     | LEFT_PAREN subquery RIGHT_PAREN subquery_operation_part*
        ///     | LEFT_PAREN expressions RIGHT_PAREN
        ///     ;
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override object VisitAtom([NotNull] PlSqlParser.AtomContext context)
        {
            object result = null;

            var constant = context.constant();

            if (constant != null)
            {
                result = VisitConstant(constant);
            }
            else
            {
                Stop();

                var bind_variable = context.bind_variable();
                if (bind_variable != null)
                {
                    result = VisitBind_variable(bind_variable);
                }
                else
                {
                    Stop();

                    var general_element = context.general_element();
                    if (general_element != null)
                    {
                        result = VisitGeneral_element(general_element);
                    }
                    else
                    {
                        var table_element = context.table_element();
                        if (table_element != null)
                        {
                            result = VisitTable_element(table_element);
                        }
                        else
                        {
                            Stop();

                            ///     | LEFT_PAREN subquery RIGHT_PAREN subquery_operation_part*
                            var subquery = context.subquery();
                            if (subquery != null)
                            {
                                result = VisitSubquery(subquery);
                                var subquery_operation_part = context.subquery_operation_part();
                                foreach (var item in subquery_operation_part)
                                {
                                }
                            }
                            else
                            {
                                ///     | LEFT_PAREN expressions RIGHT_PAREN
                                Stop();
                                var expressions = context.expressions();
                                result = VisitExpressions(expressions);
                            }

                            Stop();
                        }
                    }
                }
            }

            Debug.Assert(result != null);
            return(result);
        }