Get rid of unnecessary lexer rules

This commit is contained in:
Christian Beikov 2021-12-17 14:51:48 +01:00
parent 017d1a2dcd
commit c92a475892
3 changed files with 2 additions and 73 deletions

View File

@ -140,24 +140,17 @@ VERSION : [vV] [eE] [rR] [sS] [iI] [oO] [nN];
VERSIONED : [vV] [eE] [rR] [sS] [iI] [oO] [nN] [eE] [dD];
NATURALID : [nN] [aA] [tT] [uU] [rR] [aA] [lL] [iI] [dD];
ABS : [aA] [bB] [sS];
ALL : [aA] [lL] [lL];
AND : [aA] [nN] [dD];
ANY : [aA] [nN] [yY];
AS : [aA] [sS];
ASC : [aA] [sS] [cC];
AVG : [aA] [vV] [gG];
BY : [bB] [yY];
BETWEEN : [bB] [eE] [tT] [wW] [eE] [eE] [nN];
BOTH : [bB] [oO] [tT] [hH];
CASE : [cC] [aA] [sS] [eE];
CAST : [cC] [aA] [sS] [tT];
CEILING : [cC] [eE] [iI] [lL] [iI] [nN] [gG];
CLASS : [cC] [lL] [aA] [sS] [sS];
COALESCE : [cC] [oO] [aA] [lL] [eE] [sS] [cC] [eE];
COLLATE : [cC] [oO] [lL] [lL] [aA] [tT] [eE];
CONCAT : [cC] [oO] [nN] [cC] [aA] [tT];
COUNT : [cC] [oO] [uU] [nN] [tT];
CROSS : [cC] [rR] [oO] [sS] [sS];
CUBE : [cC] [uU] [bB] [eE];
CURRENT : [cC] [uU] [rR] [rR] [eE] [nN] [tT];
@ -180,22 +173,18 @@ ESCAPE : [eE] [sS] [cC] [aA] [pP] [eE];
EVERY : [eE] [vV] [eE] [rR] [yY];
EXCEPT : [eE] [xX] [cC] [eE] [pP] [tT];
EXISTS : [eE] [xX] [iI] [sS] [tT] [sS];
EXP : [eE] [xX] [pP];
EXTRACT : [eE] [xX] [tT] [rR] [aA] [cC] [tT];
FETCH : [fF] [eE] [tT] [cC] [hH];
FILTER : [fF] [iI] [lL] [tT] [eE] [rR];
FIRST : [fF] [iI] [rR] [sS] [tT];
FLOOR : [fF] [lL] [oO] [oO] [rR];
FROM : [fF] [rR] [oO] [mM];
FOR : [fF] [oO] [rR];
FORMAT : [fF] [oO] [rR] [mM] [aA] [tT];
FULL : [fF] [uU] [lL] [lL];
FUNCTION : [fF] [uU] [nN] [cC] [tT] [iI] [oO] [nN];
GREATEST : [gG] [rR] [eE] [aA] [tT] [eE] [sS] [tT];
GROUP : [gG] [rR] [oO] [uU] [pP];
HAVING : [hH] [aA] [vV] [iI] [nN] [gG];
HOUR : [hH] [oO] [uU] [rR];
IFNULL : [iI] [fF] [nN] [uU] [lL] [lL];
IN : [iI] [nN];
INDEX : [iI] [nN] [dD] [eE] [xX];
INDICES : [iI] [nN] [dD] [iI] [cC] [eE] [sS];
@ -209,38 +198,29 @@ JOIN : [jJ] [oO] [iI] [nN];
KEY : [kK] [eE] [yY];
LAST : [lL] [aA] [sS] [tT];
LEADING : [lL] [eE] [aA] [dD] [iI] [nN] [gG];
LEAST : [lL] [eE] [aA] [sS] [tT];
LEFT : [lL] [eE] [fF] [tT];
LENGTH : [lL] [eE] [nN] [gG] [tT] [hH];
LIKE : [lL] [iI] [kK] [eE];
ILIKE : [iI] [lL] [iI] [kK] [eE];
LIMIT : [lL] [iI] [mM] [iI] [tT];
LIST : [lL] [iI] [sS] [tT];
LN : [lL] [nN];
LOCAL : [lL] [oO] [cC] [aA] [lL];
LOCAL_DATE : [lL] [oO] [cC] [aA] [lL] '_' [dD] [aA] [tT] [eE];
LOCAL_DATETIME : [lL] [oO] [cC] [aA] [lL] '_' [dD] [aA] [tT] [eE] [tT] [iI] [mM] [eE];
LOCAL_TIME : [lL] [oO] [cC] [aA] [lL] '_' [tT] [iI] [mM] [eE];
LOCATE : [lL] [oO] [cC] [aA] [tT] [eE];
LOWER : [lL] [oO] [wW] [eE] [rR];
MAP : [mM] [aA] [pP];
MAX : [mM] [aA] [xX];
MAXELEMENT : [mM] [aA] [xX] [eE] [lL] [eE] [mM] [eE] [nN] [tT];
MAXINDEX : [mM] [aA] [xX] [iI] [nN] [dD] [eE] [xX];
MEMBER : [mM] [eE] [mM] [bB] [eE] [rR];
MICROSECOND : [mM] [iI] [cC] [rR] [oO] [sS] [eE] [cC] [oO] [nN] [dD];
MILLISECOND : [mM] [iI] [lL] [lL] [iI] [sS] [eE] [cC] [oO] [nN] [dD];
MIN : [mM] [iI] [nN];
MINELEMENT : [mM] [iI] [nN] [eE] [lL] [eE] [mM] [eE] [nN] [tT];
MININDEX : [mM] [iI] [nN] [iI] [nN] [dD] [eE] [xX];
MINUTE : [mM] [iI] [nN] [uU] [tT] [eE];
MOD : [mM] [oO] [dD];
MONTH : [mM] [oO] [nN] [tT] [hH];
NANOSECOND : [nN] [aA] [nN] [oO] [sS] [eE] [cC] [oO] [nN] [dD];
NEXT : [nN] [eE] [xX] [tT];
NEW : [nN] [eE] [wW];
NOT : [nN] [oO] [tT];
NULLIF : [nN] [uU] [lL] [lL] [iI] [fF];
NULLS : [nN] [uU] [lL] [lL] [sS];
OBJECT : [oO] [bB] [jJ] [eE] [cC] [tT];
OF : [oO] [fF];
@ -256,24 +236,17 @@ PAD : [pP] [aA] [dD];
PERCENT : [pP] [eE] [rR] [cC] [eE] [nN] [tT];
PLACING : [pP] [lL] [aA] [cC] [iI] [nN] [gG];
POSITION : [pP] [oO] [sS] [iI] [tT] [iI] [oO] [nN];
POWER : [pP] [oO] [wW] [eE] [rR];
QUARTER : [qQ] [uU] [aA] [rR] [tT] [eE] [rR];
REPLACE : [rR] [eE] [pP] [lL] [aA] [cC] [eE];
RIGHT : [rR] [iI] [gG] [hH] [tT];
ROLLUP : [rR] [oO] [lL] [lL] [uU] [pP];
ROUND : [rR] [oO] [uU] [nN] [dD];
ROWS : [rR] [oO] [wW] [sS];
ROW : [rR] [oO] [wW];
SECOND : [sS] [eE] [cC] [oO] [nN] [dD];
SELECT : [sS] [eE] [lL] [eE] [cC] [tT];
SET : [sS] [eE] [tT];
SIGN : [sS] [iI] [gG] [nN];
SIZE : [sS] [iI] [zZ] [eE];
SOME : [sS] [oO] [mM] [eE];
SQRT : [sS] [qQ] [rR] [tT];
STR : [sS] [tT] [rR];
SUBSTRING : [sS] [uU] [bB] [sS] [tT] [rR] [iI] [nN] [gG];
SUM : [sS] [uU] [mM];
THEN : [tT] [hH] [eE] [nN];
TIES : [tT] [iI] [eE] [sS];
TIME : [tT] [iI] [mM] [eE];
@ -286,7 +259,6 @@ TRIM : [tT] [rR] [iI] [mM];
TYPE : [tT] [yY] [pP] [eE];
UNION : [uU] [nN] [iI] [oO] [nN];
UPDATE : [uU] [pP] [dD] [aA] [tT] [eE];
UPPER : [uU] [pP] [pP] [eE] [rR];
VALUE : [vV] [aA] [lL] [uU] [eE];
VALUES : [vV] [aA] [lL] [uU] [eE] [sS];
WEEK : [wW] [eE] [eE] [kK];
@ -295,14 +267,6 @@ WHERE : [wW] [hH] [eE] [rR] [eE];
WITH : [wW] [iI] [tT] [hH];
YEAR : [yY] [eE] [aA] [rR];
ACOS : [aA] [cC] [oO] [sH];
ASIN : [aA] [sS] [iI] [nN];
ATAN : [aA] [tT] [aA] [nN];
ATAN2 : [aA] [tT] [aA] [nN] [2];
COS : [cC] [oO] [sH];
SIN : [sS] [iI] [nN];
TAN : [tT] [aA] [nN];
// case-insensitive true, false and null recognition (split vote :)
TRUE : [tT] [rR] [uU] [eE];
FALSE : [fF] [aA] [lL] [sS] [eE];

View File

@ -917,29 +917,17 @@ rollup
identifier
: IDENTIFIER
| QUOTED_IDENTIFIER
| (ABS
| ACOS
| ALL
| (ALL
| AND
| ANY
| AS
| ASC
| ASIN
| ATAN
| ATAN2
| AVG
| BETWEEN
| BOTH
| BY
| CASE
| CAST
| CEILING
| CLASS
| COALESCE
| COLLATE
| CONCAT
| COS
| COUNT
| CROSS
| CUBE
| CURRENT
@ -962,23 +950,19 @@ identifier
| EVERY
| EXCEPT
| EXISTS
| EXP
| EXTRACT
| FETCH
| FILTER
| FIRST
| FLOOR
| FOR
| FORMAT
| FROM
| FULL
| FUNCTION
| GREATEST
| GROUP
| HAVING
| HOUR
| ID
| IFNULL
| ILIKE
| IN
| INDEX
@ -993,38 +977,29 @@ identifier
| KEY
| LAST
| LEADING
| LEAST
| LEFT
| LENGTH
| LIKE
| LIMIT
| LIST
| LN
| LOCAL
| LOCAL_DATE
| LOCAL_DATETIME
| LOCAL_TIME
| LOCATE
| LOWER
| MAP
| MAX
| MAXELEMENT
| MAXINDEX
| MEMBER
| MICROSECOND
| MILLISECOND
| MIN
| MINELEMENT
| MININDEX
| MINUTE
| MOD
| MONTH
| NANOSECOND
| NATURALID
| NEW
| NEXT
| NOT
| NULLIF
| NULLS
| OBJECT
| OF
@ -1040,26 +1015,17 @@ identifier
| PERCENT
| PLACING
| POSITION
| POWER
| QUARTER
| REPLACE
| RIGHT
| ROLLUP
| ROUND
| ROW
| ROWS
| SECOND
| SELECT
| SET
| SIGN
| SIN
| SIZE
| SOME
| SQRT
| STR
| SUBSTRING
| SUM
| TAN
| THEN
| TIES
| TIME
@ -1072,7 +1038,6 @@ identifier
| TYPE
| UNION
| UPDATE
| UPPER
| VALUE
| VALUES
| VERSION

View File

@ -3278,7 +3278,7 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
}
private SqmFunctionDescriptor getFunctionDescriptor(String name) {
return creationContext.getQueryEngine().getSqmFunctionRegistry().findFunctionDescriptor(name);
return creationContext.getQueryEngine().getSqmFunctionRegistry().findFunctionDescriptor( name );
}
@Override