12#ifndef MCRL2_CORE_PARSER_UTILITY_H
13#define MCRL2_CORE_PARSER_UTILITY_H
24template <
typename Function>
123 if (x.
symbol() != left.symbol())
127 if (x.
symbol() != right.symbol())
161 if (x.
symbol() != left.symbol())
165 if (x.
symbol() != right.symbol())
190 std::cout <<
"Warning: the expression of the form 'x && y || z' on location " << x.
line() <<
":" << x.
column() <<
" may be parsed differently than before" << std::endl;
207 std::cout <<
"Warning: the expression of the form 'x ||_ y || z' on location " << x.
line() <<
":" << x.
column() <<
" may be parsed differently than before" << std::endl;
Parse mCRL2 specifications and expressions.
void foreach_parse_node(const parse_node &x, Function f)
Calls the function f on each node in the parse tree with x as root.
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
void operator()(const parse_node &x)
const parser_table & table
find_and_or(const parser_table &table_)
void operator()(const parse_node &x)
const parser_table & table
find_left_merge_merge(const parser_table &table_)
Checks if a node is the binary operation '&&'.
is_and_node(const parser_table &table_)
Checks if a node is of type 'x && (y || z)'.
const parser_table & table
is_and_or_node(const parser_table &table_)
bool operator()(const parse_node &x)
Checks if a node is the binary operation op.
bool operator()(const parse_node &x)
const parser_table & table
is_binary_operator_node(const parser_table &table_, const std::string &op_)
Checks if a node is of type 'x ||_ (y || z)'.
const parser_table & table
is_left_merge_merge(const parser_table &table_)
bool operator()(const parse_node &x)
Checks if a node is the left merge operation '||_'.
is_left_merge_node(const parser_table &table_)
Checks if a node is the merge operation '||'.
is_merge_node(const parser_table &table_)
Checks if a node is the binary operation '||'.
is_or_node(const parser_table &table_)
parse_node child(int i) const
Wrapper for D_ParserTables.
std::string symbol_name(unsigned int i) const