13#ifndef MCRL2_CORE_PARSE_H
14#define MCRL2_CORE_PARSE_H
67 std::ostringstream out;
68 out << inherited << std::endl;
92 template <
typename Function>
109 template <
typename Function>
133 template <
typename Function>
140 template <
typename Container,
typename Function>
166 template <
typename Container,
typename Function>
173 template <
typename SetContainer,
typename Function>
199 template <
typename SetContainer,
typename Function>
217 template <
typename T,
typename Function>
220 std::vector<T> result;
225 template <
typename T,
typename Function>
228 std::vector<T> result;
245 return parse_list<core::identifier_string>(node,
"Id", [&](
const core::parse_node& node) {
return parse_Id(node); });
258 std::clog <<
"aterm: " << x << std::endl;
267 bool partial_parses =
false;
Term containing a string.
parse_node_exception(const std::string &message)
parse_node_exception(const parse_node &node, const std::string &message)
static std::string get_error_message(const parse_node &node, const std::string &user_message)
parse_node_unexpected_exception(const parser &p, const parse_node &node)
static std::string get_error_message(const parser &p, const parse_node &node)
Standard exception class for reporting runtime errors.
D_ParserTables parser_tables_fsm
D_ParserTables parser_tables_dot
D_ParserTables parser_tables_mcrl2
add your file description here.
aterm representations of identifier strings.
void syntax_error_fn(struct D_Parser *ap)
Custom syntax error function that prints both the line number and the column.
struct D_ParseNode * ambiguity_fn(struct D_Parser *, int, struct D_ParseNode **)
Function for resolving ambiguities in the '_ -> _ <> _' operator for process expressions.
void print_aterm(const T &)
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
identifier_string parse_identifier(const std::string &text)
Parse an identifier.
bool is_user_identifier(std::string const &s)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
core::identifier_string parse_Id(const parse_node &node) const
atermpp::term_list< T > parse_list(const parse_node &node, const std::string &type, const Function &f) const
default_parser_actions(const parser &parser_)
std::vector< T > parse_vector(const parse_node &node, const std::string &type, const Function &f) const
core::identifier_string_list parse_IdList(const parse_node &node) const
core::identifier_string parse_Number(const parse_node &node) const
parse_node child(int i) const
std::string add_context(const std::string &message) const
std::string string() const
bool operator()(const parse_node &node) const
collector(const parser_table &table_, const std::string &type_, Container &container_, const Function &f_)
const parser_table & table
set_collector(const parser_table &table_, const std::string &type_, SetContainer &container_, const Function &f_)
bool operator()(const parse_node &node) const
const parser_table & table
visitor(const parser_table &table_, const std::string &type_, const Function &f_)
const parser_table & table
bool operator()(const parse_node &node) const
std::string symbol_name(const parse_node &node) const
parser_actions(const parser &parser_)
void traverse(const parse_node &node, const Function &f) const
set_collector< SetContainer, Function > make_set_collector(const parser_table &table, const std::string &type, SetContainer &container, const Function &f) const
visitor< Function > make_visitor(const parser_table &table, const std::string &type, const Function &f) const
collector< Container, Function > make_collector(const parser_table &table, const std::string &type, Container &container, const Function &f) const
Wrapper for D_ParserTables.
std::string symbol_name(unsigned int i) 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
unsigned int start_symbol_index(const std::string &name) const