mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00

Remove previous lambda/curring based method Grammar was simplified for EXCEPT case Cleanup unused constants
48 lines
907 B
ObjectPascal
48 lines
907 B
ObjectPascal
%skip space \s
|
|
|
|
%token bracket_ \(
|
|
%token _bracket \)
|
|
%token quote_ " -> string
|
|
%token string:string [^"]+
|
|
%token string:_quote " -> default
|
|
%token in IN
|
|
%token and AND
|
|
%token or OR
|
|
%token except EXCEPT
|
|
%token word [^\s\(\)]+
|
|
|
|
// relative order of precedence is NOT > XOR > AND > OR
|
|
|
|
#query:
|
|
primary()
|
|
|
|
primary:
|
|
secondary() ( ::except:: #except primary() )?
|
|
|
|
secondary:
|
|
ternary() ( ::or:: #or primary() )?
|
|
|
|
ternary:
|
|
quaternary() ( ::and:: #and primary() )?
|
|
|
|
quaternary:
|
|
term() ( ::in:: #in word() )?
|
|
|
|
term:
|
|
( ::bracket_:: primary() ::_bracket:: ) | text()
|
|
|
|
#text:
|
|
( word() | keyword() | symbol() )+
|
|
|
|
word:
|
|
<word> | string()
|
|
|
|
string:
|
|
::quote_:: <string> ::_quote::
|
|
|
|
keyword:
|
|
<in> | <except> | <and> | <or>
|
|
|
|
symbol:
|
|
::bracket_:: | ::_bracket::
|