12#ifndef MCRL2_PROCESS_PARSE_H
13#define MCRL2_PROCESS_PARSE_H
58 std::istringstream in(spec_string);
69 auto pos = text.find(
'(');
70 if (pos == std::string::npos)
74 std::string name = text.substr(0, pos);
90 const std::string& data_decl,
91 const std::string& proc_decl
95 std::string init_text =
"init\n " + text +
";\n";
96 std::string spec_text = data_decl +
"\n" + proc_text +
"\n" + init_text;
107 std::vector<std::string> keywords{
"sort",
"var",
"eqn",
"map",
"cons",
"act",
"glob",
"proc",
"init"};
109 std::string init_text =
"init\n " + text +
";\n";
110 std::string ptext = result.second + init_text;
116template <
typename VariableContainer>
121 globvars.insert(variables.begin(), variables.end());
126 return procspec2.
init();
129template <
typename VariableContainer,
typename ActionLabelContainer,
typename ProcessIdentifierContainer>
131 const VariableContainer& variables = VariableContainer(),
133 const ActionLabelContainer& action_labels = std::vector<action_label>(),
134 const ProcessIdentifierContainer& process_identifiers = ProcessIdentifierContainer(),
Term containing a string.
\brief A process expression
\brief A process identifier
Process specification consisting of a data specification, action labels, a sequence of process equati...
const process_expression & init() const
Returns the initialization of the process specification.
const std::set< data::variable > & global_variables() const
Returns the declared free variables of the process specification.
Parser for data specifications.
static data_specification const & default_specification()
variable_list parse_variable_declaration_list(const std::string &text, const data_specification &dataspec=detail::default_specification())
Parses a variable declaration list.
process_specification parse_process_specification_new(const std::string &text)
void complete_process_specification(process_specification &x, bool alpha_reduce=false)
process_expression parse_process_expression_new(const std::string &text)
process_expression typecheck_process_expression(const process_expression &x, const VariableContainer &variables=VariableContainer(), const data::data_specification &dataspec=data::data_specification(), const ActionLabelContainer &action_labels=ActionLabelContainer(), const ProcessIdentifierContainer &process_identifiers=ProcessIdentifierContainer(), const process_identifier *current_equation=nullptr)
Typecheck a process expression.
process::action_label_list parse_action_declaration(const std::string &text, const data::data_specification &data_spec=data::detail::default_specification())
Parses an action declaration from a string.
atermpp::term_list< action_label > action_label_list
\brief list of action_labels
process_expression parse_process_expression(const std::string &text, const std::string &data_decl, const std::string &proc_decl)
Parses and type checks a process expression.
std::string pp(const action_label &x)
action translate_user_notation(const action &x)
process_identifier parse_process_identifier(std::string text, const data::data_specification &dataspec)
Parses a process identifier.
process_specification parse_process_specification(std::istream &in)
Parses a process specification from an input stream.
std::pair< std::string, std::string > separate_keyword_section(const std::string &text1, const std::string &keyword, const std::vector< std::string > &all_keywords, bool repeat_keyword=false)
std::string regex_replace(const std::string &src, const std::string &dest, const std::string &text)
Regular expression replacement in a string.
std::string read_text(const std::string &filename, bool warn=false)
Read text from a file.
std::string trim_copy(const std::string &text)
Remove all trailing and leading spaces from the input.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
add your file description here.
add your file description here.