// 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); }
/// <summary> /// Visit a parse tree produced by <see cref="SQLiteParser.parse"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitParse([NotNull] SQLiteParser.ParseContext context) { return(VisitChildren(context)); }