jjdoc.queryparser.queryparser.html Maven / Gradle / Ivy
BNF for queryparser.jj
BNF for queryparser.jj
TOKENS
<DEFAULT> SKIP : {
<" " | "\t" | "\n" | "\r">
}
<DEFAULT> TOKEN : {
<AND: ("a" | "A") ("n" | "N") ("d" | "D") | "&">
| <OR: ("o" | "O") ("r" | "R") | "|">
| <NOT: ("n" | "N") ("o" | "O") ("t" | "T") | "!">
| <PLUS: "+">
| <MINUS: "-">
| <LPAREN: "(">
| <RPAREN: ")">
| <LBRACKET: "[">
| <RBRACKET: "]">
| <LCBRACKET: "{">
| <RCBRACKET: "}">
| <DATE_TERM: <NUMBER> <NUMBER> (<NUMBER> <NUMBER>)? ["/","-","."] <NUMBER> <NUMBER> ["/","-","."] <NUMBER> <NUMBER> (<NUMBER> <NUMBER>)?>
| <NUMBER_TERM: (["+","-"])? (<NUMBER>)+ ("." (<NUMBER>)*)? (["e","E"] (<NUMBER>)+)?>
| <FIELD: (["0"-"9","A"-"Z","a"-"z","_","-","."])+ ":">
| <QUOTE: "\"">
| <SINGLE_QUOTE: "\'">
| <QUOTED_STRING: <QUOTE> (~["\""])+ <QUOTE>>
| <WILDCARD: "*">
| <TO: ("t" | "T") ("o" | "O")>
| <TERM: (["0"-"9","A"-"Z","a"-"z","_","-","\u0080"-"\uffff"])+>
| <NUMBER: ["0"-"9"]>
}
NON-TERMINALS
query
::=
( expresion )* ( <TERM> | <QUOTED_STRING> | <AND> | <OR> | <NOT> | <NUMBER_TERM> | <MINUS> | <PLUS> | <WILDCARD> | <LPAREN> | <RPAREN> | <LBRACKET> | <RBRACKET> | <LCBRACKET> | <RCBRACKET> | <SINGLE_QUOTE> | <QUOTE> )*
/********************** Literals **************************************************/
literal
::=
literalClause ( <OR> literalClause )*
literalClause
::=
baseLiteral ( <AND> baseLiteral )*
baseLiteral
::=
( <LPAREN> literal <RPAREN> | simpleLiteral | unaryBooleanLiteral )
simpleLiteral
::=
( rangeLiteral | termsLiteral )
termsLiteral
::=
( <TERM> | <QUOTED_STRING> | <NUMBER_TERM> | ( <LPAREN> ( <TERM> | <QUOTED_STRING> | <NUMBER_TERM> )+ <RPAREN> ) )
unaryBooleanLiteral
::=
( <NOT> | <MINUS> ) ( baseLiteral )
rangeLiteral
::=
( numericRangeLiteral | dateRangeLiteral )
numericRangeLiteral
::=
<LBRACKET> ( <NUMBER_TERM> | <WILDCARD> ) <TO> ( <NUMBER_TERM> | <WILDCARD> ) <RBRACKET>
dateRangeLiteral
::=
<LBRACKET> ( <DATE_TERM> | <WILDCARD> ) <TO> ( <DATE_TERM> | <WILDCARD> ) <RBRACKET>
/***************************Expresions******************************************/
expresion
::=
clause ( <OR> clause )*
clause
::=
baseClause ( <AND> baseClause )*
baseClause
::=
( <LPAREN> expresion <RPAREN> | fieldClause | unaryBooleanClause )
fieldClause
::=
( <PLUS> | <MINUS> )? <FIELD> literal
unaryBooleanClause
::=
( <NOT> ) ( baseClause )