boolexpr-0.1: Boolean expressions with various representations and search queries.




Parsing function

parseBoolExpr :: CharParser st a -> CharParser st (BoolExpr a)Source

Parse a search query as a boolean tree using the following grammar. Note that this parser is parameterized over the parser of query simple terms (const).

  bt ::= bt AND bt
        | bt bt -- same as AND
        | bt OR bt
        | - bt
        | ( bt )
        | const
   const ::= <given as argument>

Language definition and components

languageDef :: LanguageDef stSource

Basic language definition for search queries. Reserved names are "AND" "OR" and "-". Identifiers accepts almost every ASCII sequences without blanks nor '-'.

lexer :: TokenParser stSource

Underlying lexer of languageDef