BNF for FilterParser.jj

TOKENS

/** Lexer. */

// This stuff separates terms
<DEFAULT> SKIP : {
" "
| "\t"
| "\n"
| "\r"
}

   
// Operators
<DEFAULT> TOKEN : {
<AND: "and" | "&" | "\u2227">
}

   
<DEFAULT> TOKEN : {
<OR: "or" | "|" | "\u2228">
}

   
<DEFAULT> TOKEN : {
<NOT: "not" | "!" | "~">
}

   
<DEFAULT> TOKEN : {
<TRUE: "true" | "TRUE">
}

   
<DEFAULT> TOKEN : {
<FALSE: "false" | "FALSE">
}

   
<DEFAULT> TOKEN : {
<OPENPAREN: "(">
}

   
<DEFAULT> TOKEN : {
<CLOSEPAREN: ")">
}

   
/* A word is a sequence of alphanumeric characters, dollar signs or dots. */
<DEFAULT> TOKEN : {
<WORD: (["a"-"z","A"-"Z","0"-"9","_",".","$"])+>
}

   
<DEFAULT> TOKEN : {
<ARGS: "(" (~["(",")"])* ")">
}

   
   
   
   
   
   
   
   
   
   

NON-TERMINALS

/** Parser. */
start ::= or
or ::= and ( <OR> and )*
and ::= atom ( <AND> atom )*
atom ::= ground
| <NOT> ground
ground ::= ( <WORD> <ARGS> )
| <TRUE>
| <FALSE>
| ( <OPENPAREN> start <CLOSEPAREN> )