Exemplo n.º 1
0
        public static Expr ParseExpr(string expr)
        {
            RawParser parser = new RawParser();

            parser.Init(expr);
            SQLiteParser.ExprContext exprContext = parser.sqlParser_.expr();
            return(parser.visitor_.Visit(exprContext) as Expr);
        }
Exemplo n.º 2
0
        // sqlbatch can also be a single sql statement - however, it won't allow you to
        // directly retrieve phyplan_ etc without go through list
        //
        public static StatementList ParseSqlStatements(string sqlbatch)
        {
            RawParser parser = new RawParser();

            parser.Init(sqlbatch);
            SQLiteParser.Sql_stmt_listContext stmtCxt = parser.sqlParser_.sql_stmt_list();
            return(parser.visitor_.VisitSql_stmt_list(stmtCxt) as StatementList);
        }
Exemplo n.º 3
0
        // sqlbatch can also be a single sql statement - however, it won't allow you to
        // directly retrieve phyplan_ etc without go through list
        //
        public static StatementList ParseSqlStatements(string sqlbatch)
        {
            RawParser parser = new RawParser();

            parser.Init(sqlbatch);

            // parse sql statements from parse rule.
            // any syntax can be catched by @SyntaxErrorListener.
            // otherwise parser silently truncate unrecognized part.
            SQLiteParser.ParseContext stmtCxt = parser.sqlParser_.parse();
            return(parser.visitor_.VisitParse(stmtCxt) as StatementList);
        }