12#ifndef MCRL2_DATA_PARSE_H
13#define MCRL2_DATA_PARSE_H
86 std::istringstream spec_stream(text);
113template <
typename OutputIterator,
typename VariableIterator>
116 VariableIterator begin,
117 VariableIterator end,
139 for (VariableIterator i = begin; i != end; ++i)
141 if (v.name()==i->name())
148 if ((v1 != v) && (v1.name() == v.name()))
157 std::copy(data_vars.
begin(), data_vars.
end(), o);
170template <
typename OutputIterator,
typename VariableIterator>
173 VariableIterator begin,
174 VariableIterator end,
177 std::istringstream spec_stream(text);
187template <
typename OutputIterator>
202template <
typename OutputIterator>
221 std::vector<variable> v;
253 std::ostringstream input;
254 input << text.rdbuf();
275template <
typename VariableContainer>
277 const VariableContainer& variables,
279 bool type_check =
true,
311template <
typename VariableContainer>
313 const VariableContainer& variables,
315 bool type_check =
true,
320 std::istringstream spec_stream(text);
336 bool type_check =
true,
356 bool type_check =
true,
367 std::vector<variable> result;
402 std::istringstream spec_stream(text);
412 const std::string prefix =
"UNIQUE_FUNCTION_SYMBOL_PREFIX";
414 std::string::size_type pos = s.find_first_of(
':');
416 std::string type = prefix + s.substr(pos);
417 std::string spec_text = dataspec_text +
"\nmap " + prefix + type +
";\n";
446std::pair<std::string, data_expression_list>
parse_variable(std::string
const& text)
451 std::string::size_type idx = text.find(
'(');
452 if (idx == std::string::npos)
458 name = text.substr(0, idx);
459 assert(*text.rbegin() ==
')');
460 std::string w = text.substr(idx + 1, text.size() - idx - 2);
462 for (
const std::string& s: v)
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
void translate_user_notation()
Translate user notation within the equations of the data specification.
const function_symbol_vector & user_defined_mappings() const
Gets all user defined mappings in this specification.
const sort_expression & sort() const
Standard exception class for reporting runtime errors.
add your file description here.
term_list< Term > reverse(const term_list< Term > &l)
Returns the list with the elements in reversed order.
data_expression parse_data_expression(const std::string &text)
data_specification parse_data_specification_new(const std::string &text)
variable_list parse_variable_declaration_list(const std::string &text)
variable_list parse_variables(const std::string &text)
static data_specification const & default_specification()
sort_expression parse_sort_expression(const std::string &text)
void parse_variables(std::istream &in, OutputIterator o, VariableIterator begin, VariableIterator end, const data_specification &data_spec=detail::default_specification())
Parses and type checks a data variable declaration list checking for double occurrences of variables ...
void typecheck_sort_expression(const sort_expression &sort_expr, const data_specification &data_spec)
Type check a sort expression. Throws an exception if something went wrong.
data_expression parse_data_expression(std::istream &in, const VariableContainer &variables, const data_specification &dataspec=detail::default_specification(), bool type_check=true, bool translate_user_notation=true, bool normalize_sorts=true)
Parses and type checks a data expression.
variable_list parse_variable_declaration_list(const std::string &text, const data_specification &dataspec=detail::default_specification())
Parses a variable declaration list.
data::data_equation translate_user_notation(const data::data_equation &x)
sort_expression parse_sort_expression(std::istream &in, const data_specification &data_spec=detail::default_specification())
Parses and type checks a sort expression.
data_specification parse_data_specification(std::istream &in)
Parses a and type checks a data specification.
void typecheck_data_specification(data_specification &data_spec)
Type check a parsed mCRL2 data specification. Throws an exception if something went wrong.
data_expression typecheck_data_expression(const data_expression &x, const VariableContainer &variables, const data_specification &dataspec=data_specification())
Type check a data expression. Throws an exception if something went wrong.
std::vector< data_expression > data_expression_vector
\brief vector of data_expressions
data::function_symbol parse_function_symbol(const std::string &text, const std::string &dataspec_text="")
std::string pp(const abstraction &x)
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
atermpp::term_list< variable > variable_list
\brief list of variables
std::pair< basic_sort_vector, alias_vector > parse_sort_specification(const std::string &text)
data_expression normalize_sorts(const data_expression &x, const data::sort_specification &sortspec)
variable parse_variable(const std::string &text, const data_specification &data_spec=detail::default_specification())
Parses and type checks a data variable declaration.
void trim(std::string &text)
Remove all trailing and leading spaces from the input.
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.
std::vector< std::string > split(const std::string &line, const std::string &separators)
Split the text.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...