File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/main/javacc/net/sf/jsqlparser/parser Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
225225| <K_MINUS:"MINUS">
226226| <K_OVER:"OVER">
227227| <K_PARTITION:"PARTITION">
228+ | <K_EXTRACT:"EXTRACT">
228229}
229230
230231
@@ -1426,6 +1427,8 @@ Expression PrimaryExpression():
14261427 | "?" { retval = new JdbcParameter(); }
14271428
14281429 | LOOKAHEAD(AnalyticExpression()) retval=AnalyticExpression()
1430+
1431+ | LOOKAHEAD(ExtractExpression()) retval=ExtractExpression()
14291432
14301433 | LOOKAHEAD([ "+" | "-"] Function()) [ "+" | "-" { isInverse = true; }] retval=Function()
14311434
@@ -1480,6 +1483,19 @@ AnalyticExpression AnalyticExpression() :
14801483 }
14811484}
14821485
1486+ ExtractExpression ExtractExpression() :
1487+ {
1488+ ExtractExpression retval = new ExtractExpression();
1489+ Token token = null;
1490+ Expression expr = null;
1491+ }
1492+ {
1493+ <K_EXTRACT> "(" token=<S_IDENTIFIER> { retval.setName(token.image); } <K_FROM> expr=PrimaryExpression() ")"
1494+ {
1495+ return retval;
1496+ }
1497+ }
1498+
14831499CastExpression CastExpression():
14841500{
14851501 CastExpression retval = new CastExpression();
You can’t perform that action at this time.
0 commit comments