Exemple #1
0
        public override object VisitParse([NotNull] SqlParser.ParseContext context)
        {
            if (context.exception != null)
            {
                throw new SQLParseException($"Incorrect syntax near '{context.exception.OffendingToken.Text}'");
            }

            if (context.ChildCount > 2)
            {
                throw new SQLParseException($"Incorrect syntax near '{context.GetChild(1)}'");
            }

            object result = null;

            if (context.sql_stmt_list() != null)
            {
                result = VisitSql_stmt_list(context.sql_stmt_list());
            }
            else
            {
                throw new SQLParseException($"Incorrect syntax near '{context.GetChild(0)}'");
            }

            return(result);
        }