org.joo.libra.sql.antlr.SqlLexerCommon.g4 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joo-libra Show documentation
Show all versions of joo-libra Show documentation
Java Predicate with SQL-like syntax support
lexer grammar SqlLexerCommon;
fragment Digit: '0'..'9' ;
fragment Alpha: '.' | '_' | 'A'..'Z' | 'a'..'z' ;
AND: ('AND' | 'and') ;
OR: ('OR' | 'or') ;
NOT: ('NOT' | 'not') ;
IS_EQUALS: ('IS' | 'is') ;
IS_EQUALS_NOT: ('IS NOT' | 'is not') ;
IS_EMPTY: ('IS EMPTY' | 'is empty') ;
IS_NOT_EMPTY: ('IS NOT EMPTY' | 'is not empty') ;
CONTAINS: ('CONTAINS' | 'contains') ;
IN: ('IN' | 'in') ;
MATCHES: ('MATCHES' | 'matches') ;
TRUE: ('TRUE' | 'true') ;
FALSE: ('FALSE' | 'false') ;
UNDEFINED: ('UNDEFINED' | 'undefined') ;
NULL: ('NULL' | 'null') ;
ANY: ('ANY' | 'any') ;
NONE: ('NONE' | 'none') ;
ALL: ('ALL' | 'all') ;
OF: ('OF' | 'of') ;
SATISFIES: ('SATISFIES' | 'satisfies') ;
GREATER_THAN: '>' ;
GREATER_THAN_EQUALS: '>=' ;
LESS_THAN: '<' ;
LESS_THAN_EQUALS: '<=' ;
EQUALS: '=' ;
NOT_EQUALS: '!=' ;
DBL_EQUALS: '==' ;
PLUS: '+' ;
MINUS: '-' ;
TIMES: '*' ;
DIVIDE: '/' ;
MOD: '%' ;
POW: '^' ;
QUESTION: '?' ;
COLON: ':' ;
LPAREN: '(' ;
RPAREN: ')' ;
LBRACE: '{' ;
RBRACE: '}' ;
COMMA: ',' ;
STRING: '\'' ~('\r' | '\n' | '\'')* '\'' ;
INTEGER: '-'* Digit+ ;
DOUBLE: '-'* Digit+'.'Digit+ ;
INDEX: '[' Digit+ ']' ;
VARIABLE: Alpha+ (Alpha | Digit | INDEX)* ;
WS: (' ' | '\t')+ -> channel(HIDDEN) ;