Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- parseBoolExpr :: CharParser st a -> CharParser st (BoolExpr a)
- languageDef :: LanguageDef st
- lexer :: TokenParser st
- identifier :: CharParser st String
- whiteSpace :: CharParser st ()
- symbol :: String -> CharParser st String
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 | NOT bt | ( bt ) | const const ::= <given as argument>
Language definition and components
languageDef :: LanguageDef st Source #
Basic language definition for search queries.
Reserved names are "AND"
"OR"
and "-"
.
Identifiers accepts almost every ASCII sequences without blanks nor '-'
.
lexer :: TokenParser st Source #
Underlying lexer of languageDef
identifier :: CharParser st String Source #
Shorthand for identifier
lexer
.
whiteSpace :: CharParser st () Source #
Shorthand for whiteSpace
lexer
.