首先,我们要创建一个SQL解析监听器
public class ParseListener extends PlSqlParserBaseListener {
@Override
public void enterSql_script(PlSqlParser.Sql_scriptContext ctx) {
findTarget(ctx);
}
private void findTarget(ParserRuleContext ctx){
ctx.children.forEach(parseTree -> {
if(parseTree instanceof PlSqlParser.Table_ref_aux_internal_oneContext){
PlSqlParser.Table_ref_aux_internal_oneContext context= (PlSqlParser.Table_ref_aux_internal_oneContext) parseTree;
System.out.println(context.getText());
}
else{
if(parseTree instanceof ParserRuleContext){
findTarget((ParserRuleContext)parseTree);
}
}
});
}
}
main函数:
public class Test {
public static void main(String[] args) {
String sql="select * from user u,foo where u.id=12";
PlSqlLexer lexer = new PlSqlLexer(CharStreams.fromString(sql));
PlSqlParser parser = new PlSqlParser(new CommonTokenStream(lexer));
ParseTreeWalker.DEFAULT.walk(new ParseListener(),parser.sql_script());
}
} 最后一次更新于2022-08-30


2025年10月新盘 做第一批吃螃蟹的人coinsrore.com
新车新盘 嘎嘎稳 嘎嘎靠谱coinsrore.com
新车首发,新的一年,只带想赚米的人coinsrore.com
新盘 上车集合 留下 我要发发 立马进裙coinsrore.com
做了几十年的项目 我总结了最好的一个盘(纯干货)coinsrore.com
新车上路,只带前10个人coinsrore.com
新盘首开 新盘首开 征召客户!!!coinsrore.com
新项目准备上线,寻找志同道合 的合作伙伴coinsrore.com
新车即将上线 真正的项目,期待你的参与coinsrore.com
新盘新项目,不再等待,现在就是最佳上车机会!coinsrore.com
新盘新盘 这个月刚上新盘 新车第一个吃螃蟹!coinsrore.com
By toidelmvmn at October 7th, 2025 at 07:26 pm.
新车即将上线 真正的项目,期待你的参与
By quzknboclq at October 6th, 2025 at 07:00 pm.
情感真挚自然,字里行间传递出强烈的感染力。
By cshpxalshc at March 4th, 2025 at 07:35 pm.
若能对分论点进一步细分,结构会更立体。
By zldbaysrwj at March 2nd, 2025 at 10:51 pm.
这是一篇佳作,无论是从内容、语言还是结构上,都堪称完美。
By yexwtxsjsh at March 2nd, 2025 at 09:17 pm.
《中华战士国语》动作片高清在线免费观看:https://www.jgz518.com/xingkong/18630.html
By axvcpfttkf at January 3rd, 2025 at 08:27 am.
《青木之年》电影片高清在线免费观看:https://www.jgz518.com/xingkong/157976.html
By ikedvbtyek at December 26th, 2024 at 08:39 am.
你的文章内容非常卖力,让人点赞。 http://www.55baobei.com/dMqxYW9gSi.html
By rmamxjzyww at December 15th, 2024 at 03:56 am.
你的文章让我感受到了正能量,非常棒! https://www.yonboz.com/video/7387.html
By ggamyxjvjv at November 18th, 2024 at 05:01 pm.
《营救计划》剧情片高清在线免费观看:https://www.jgz518.com/xingkong/18902.html
By kgmyqwuzxq at November 13th, 2024 at 05:15 am.
你的才华让人瞩目,期待你的更多文章。 https://www.4006400989.com/qyvideo/87747.html
By zqkzpskvor at November 12th, 2024 at 06:01 pm.
文章的确不错啊https://www.cscnn.com/
By xkmhhbqlrb at October 19th, 2024 at 05:37 pm.
不错不错,我喜欢看 www.jiwenlaw.com
By cukqpdioux at October 6th, 2024 at 08:00 pm.
看的我热血沸腾啊https://www.jiwenlaw.com/
By wkvwxdwdqx at September 23rd, 2024 at 09:54 am.