32 namespace BooleanFunctionParser
72 std::vector<BooleanFunction::Value>
constant{};
138 static Token Constant(std::vector<BooleanFunction::Value> value);
Result< std::vector< Token > > parse_with_standard_grammar(const std::string &expression)
Result< std::vector< Token > > parse_with_liberty_grammar(const std::string &expression)
ParserType
ParserType refers to the parser identifier.
@ Liberty
refers to the 'Liberty' Boolean function parser
@ Standard
refers to the 'Standard' Boolean function parser
Result< BooleanFunction > translate(std::vector< Token > &&tokens, const std::string &expression)
TokenType
TokenType refers to a token identifier for a Boolean function string.
Result< std::vector< Token > > reverse_polish_notation(std::vector< Token > &&tokens, const std::string &expression, const ParserType &parser)
Token refers to a token identifier and accompanied data.
static Token BracketOpen()
std::tuple< std::string, u16 > variable
optional value and bit-size in case token is a variable
static Token BracketClose()
std::string to_string() const
TokenType type
refers to the underlying token type identifier
static Token Constant(std::vector< BooleanFunction::Value > value)
Token(TokenType _type, std::tuple< std::string, u16 > variable, std::vector< BooleanFunction::Value > constant)
Construct a new initialized Token.
bool is(TokenType type) const
static Token Variable(std::string name, u16 size)
friend std::ostream & operator<<(std::ostream &os, const Token &token)
std::vector< BooleanFunction::Value > constant
optional value in case token is a constant
unsigned precedence(const ParserType &type) const