37 namespace BooleanFunctionParser
85 std::vector<BooleanFunction::Value>
constant{};
193 static Token Constant(std::vector<BooleanFunction::Value> value);
274 Result<std::vector<Token>>
parse_with_liberty_grammar(
const std::string& expression,
const std::map<std::string, u16>& var_sizes = {});
300 Result<BooleanFunction>
translate(std::vector<Token>&& tokens,
const std::string& expression);
Result< std::vector< Token > > parse_with_standard_grammar(const std::string &expression, const std::map< std::string, u16 > &var_sizes={})
ParserType
ParserType refers to the parser identifier.
@ Liberty
refers to the 'Liberty' Boolean function parser
@ LibertyNoSpace
as 'Liberty' above, but removing space first
@ 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)
Result< std::vector< Token > > parse_with_liberty_grammar(const std::string &expression, const std::map< std::string, u16 > &var_sizes={})
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
bool is_left_associative() 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