Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/smvlang/smv_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ void smv_languaget::dependencies(

const smv_parse_treet::modulet &smv_module=m_it->second;

for(auto &item : smv_module.items)
if(item.is_var() && item.expr.type().id() == ID_smv_submodule)
for(auto &element : smv_module.elements)
if(element.is_var() && element.expr.type().id() == ID_smv_submodule)
module_set.insert(
id2string(to_smv_submodule_type(item.expr.type()).identifier()));
id2string(to_smv_submodule_type(element.expr.type()).identifier()));
}

/*******************************************************************\
Expand Down Expand Up @@ -145,38 +145,38 @@ void smv_languaget::show_parse(std::ostream &out, message_handlert &)

out << " VARIABLES:" << std::endl;

for(auto &item : module.items)
if(item.is_var() && item.expr.type().id() != ID_smv_submodule)
for(auto &element : module.elements)
if(element.is_var() && element.expr.type().id() != ID_smv_submodule)
{
symbol_tablet symbol_table;
namespacet ns{symbol_table};
auto identifier = to_smv_identifier_expr(item.expr).identifier();
auto msg = type2smv(item.expr.type(), ns);
auto identifier = to_smv_identifier_expr(element.expr).identifier();
auto msg = type2smv(element.expr.type(), ns);
out << " " << identifier << ": " << msg << ";\n";
}

out << std::endl;

out << " SUBMODULES:" << std::endl;

for(auto &item : module.items)
if(item.is_var() && item.expr.type().id() == ID_smv_submodule)
for(auto &element : module.elements)
if(element.is_var() && element.expr.type().id() == ID_smv_submodule)
{
symbol_tablet symbol_table;
namespacet ns(symbol_table);
auto identifier = to_smv_identifier_expr(item.expr).identifier();
auto msg = type2smv(item.expr.type(), ns);
auto identifier = to_smv_identifier_expr(element.expr).identifier();
auto msg = type2smv(element.expr.type(), ns);
out << " " << identifier << ": " << msg << ";\n";
}

out << std::endl;

out << " ITEMS:" << std::endl;

forall_item_list(it, module.items)
for(auto &element : module.elements)
{
out << " TYPE: " << to_string(it->item_type) << std::endl;
out << " EXPR: " << it->expr.pretty() << std::endl;
out << " TYPE: " << to_string(element.element_type) << '\n';
out << " EXPR: " << element.expr.pretty() << '\n';
out << std::endl;
}
}
Expand Down
32 changes: 18 additions & 14 deletions src/smvlang/smv_parse_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,35 @@ Function: operator <<

\*******************************************************************/

std::string to_string(smv_parse_treet::modulet::itemt::item_typet i)
std::string to_string(smv_parse_treet::modulet::elementt::element_typet i)
{
switch(i)
{
case smv_parse_treet::modulet::itemt::ASSIGN_CURRENT:
case smv_parse_treet::modulet::elementt::ASSIGN_CURRENT:
return "ASSIGN CURRENT";
case smv_parse_treet::modulet::itemt::ASSIGN_INIT:
case smv_parse_treet::modulet::elementt::ASSIGN_INIT:
return "ASSIGN INIT";
case smv_parse_treet::modulet::itemt::ASSIGN_NEXT:
case smv_parse_treet::modulet::elementt::ASSIGN_NEXT:
return "ASSIGN NEXT";
case smv_parse_treet::modulet::itemt::INVAR: return "INVAR";
case smv_parse_treet::modulet::itemt::TRANS: return "TRANS";
case smv_parse_treet::modulet::itemt::INIT: return "INIT";
case smv_parse_treet::modulet::itemt::CTLSPEC:
case smv_parse_treet::modulet::elementt::INVAR:
return "INVAR";
case smv_parse_treet::modulet::elementt::TRANS:
return "TRANS";
case smv_parse_treet::modulet::elementt::INIT:
return "INIT";
case smv_parse_treet::modulet::elementt::CTLSPEC:
return "SPEC";
case smv_parse_treet::modulet::itemt::LTLSPEC:
case smv_parse_treet::modulet::elementt::LTLSPEC:
return "LTLSPEC";
case smv_parse_treet::modulet::itemt::FAIRNESS: return "FAIRNESS";
case smv_parse_treet::modulet::itemt::DEFINE:
case smv_parse_treet::modulet::elementt::FAIRNESS:
return "FAIRNESS";
case smv_parse_treet::modulet::elementt::DEFINE:
return "DEFINE";
case smv_parse_treet::modulet::itemt::ENUM:
case smv_parse_treet::modulet::elementt::ENUM:
return "ENUM";
case smv_parse_treet::modulet::itemt::IVAR:
case smv_parse_treet::modulet::elementt::IVAR:
return "IVAR";
case smv_parse_treet::modulet::itemt::VAR:
case smv_parse_treet::modulet::elementt::VAR:
return "VAR";

default:;
Expand Down
Loading
Loading