[][src]Module biodivine_lib_bdd::boolean_expression::_impl_parser

(internal) Parsing functions for boolean expressions.

Expression parsing proceeds in recursive manner in the order of operator precedence: <=>, =>, |, & and ^. For each operator, if there is no occurrence in the root of the token tree, we forward the tree to next operator. If there is an occurrence, we split the token tree at this point. Left part goes to the next operator, right part is processed by the same operator to extract additional occurrences.

Enums

ExprToken

(internal) Tokens that can appear in the boolean expression. The tokens form a token tree defined by parenthesis groups.

Functions

and

(internal) Recursive parsing step 4: extract & operators.

iff

(internal) Recursive parsing step 1: extract <=> operators.

imp

(internal) Recursive parsing step 2: extract => operators.

index_of_first

(internal) Utility method to find first occurrence of a specific token in the token tree.

or

(internal) Recursive parsing step 3: extract | operators.

parse_boolean_expression

Takes a String and turns it into a BooleanExpression or Error if the string is not valid.

parse_formula

(internal) Parse a ExprToken tree into a BooleanExpression (or error if invalid).

terminal

(internal) Recursive parsing step 6: extract terminals and negations.

tokenize_group

(internal) Process a peekable iterator of characters into a vector of ExprTokens.

xor

(internal) Recursive parsing step 5: extract ^ operators.