12#ifndef MCRL2_CORE_DPARSER_H
13#define MCRL2_CORE_DPARSER_H
25typedef struct D_ParseNode *(*D_AmbiguityFn)(
struct D_Parser *,
26 int n,
struct D_ParseNode **v);
37std::string
add_context(
const d_loc_t* loc,
const std::string& message);
90 explicit parse_node(D_ParseNode* n, D_Parser* parser_ =
nullptr)
100 std::string
string()
const;
101 std::string
tree()
const;
105 std::string
add_context(
const std::string& message)
const;
107 explicit operator bool()
const
109 return node !=
nullptr;
167 std::string
indent(
unsigned int count)
const;
169 std::string
truncate(
const std::string& s,
unsigned int max_size = 20)
const;
178 void announce(D_ParseNode& node_ref);
183 <<
"string = " << node.
string() << std::endl
195 std::ostringstream out;
struct D_ParseNode *(* D_AmbiguityFn)(struct D_Parser *, int n, struct D_ParseNode **v)
void(* D_SyntaxErrorFn)(struct D_Parser *)
std::string add_context(const d_loc_t *loc, const std::string &message)
void increment_dparser_error_message_count()
void set_dparser_max_error_message_count(std::size_t n)
void reset_dparser_error_message_count()
std::size_t get_dparser_max_error_message_count()
std::size_t get_dparser_error_message_count()
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
static std::size_t max_value
parse_node child(int i) const
std::string pathname() const
parse_node find_in_tree(int symbol) const
std::string add_context(const std::string &message) const
parse_node(D_ParseNode *n, D_Parser *parser_=nullptr)
std::string string() const
Wrapper for D_ParserTables.
std::string symbol_name(unsigned int i) const
std::string tree(const core::parse_node &node) const
bool is_term_symbol(unsigned int i) const
int start_symbol(unsigned int i) const
unsigned int start_symbol_index(const std::string &name) const
parser_table(D_ParserTables &table)
unsigned int symbol_count() const
Wrapper for D_Parser and its corresponding D_ParserTables.
void print_node(std::ostream &out, const parse_node &node) const
parse_node parse(const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
Parses a string. N.B. The user is responsible for destruction of the returned value by calling destro...
const parser_table & symbol_table() const
void announce(D_ParseNode &node_ref)
Callback function for nodes in the parse tree.
std::string print_node(const parse_node &node) const
void custom_parse_error(const std::string &message) const
void print_symbol_table() const
std::size_t m_max_error_message_count
std::string indent(unsigned int count) const
std::string truncate(const std::string &s, unsigned int max_size=20) const
void print_tree(const parse_node &node, unsigned int level=0) const
unsigned int start_symbol_index(const std::string &name) const
void destroy_parse_node(const parse_node &node)