|
12 | 12 | #include <util/symbol_table.h> |
13 | 13 |
|
14 | 14 | #include "expr2smv.h" |
| 15 | +#include "smv_expr.h" |
15 | 16 | #include "smv_parser.h" |
16 | 17 | #include "smv_typecheck.h" |
17 | 18 |
|
@@ -67,10 +68,9 @@ void smv_languaget::dependencies( |
67 | 68 |
|
68 | 69 | const smv_parse_treet::modulet &smv_module=m_it->second; |
69 | 70 |
|
70 | | - for(smv_parse_treet::mc_varst::const_iterator it=smv_module.vars.begin(); |
71 | | - it!=smv_module.vars.end(); it++) |
72 | | - if(it->second.type.id()=="submodule") |
73 | | - module_set.insert(it->second.type.get_string("identifier")); |
| 71 | + for(auto &item : smv_module.items) |
| 72 | + if(item.is_var() && item.expr.type().id() == "submodule") |
| 73 | + module_set.insert(item.expr.type().get_string("identifier")); |
74 | 74 | } |
75 | 75 |
|
76 | 76 | /*******************************************************************\ |
@@ -143,29 +143,28 @@ void smv_languaget::show_parse(std::ostream &out, message_handlert &) |
143 | 143 |
|
144 | 144 | out << " VARIABLES:" << std::endl; |
145 | 145 |
|
146 | | - for(smv_parse_treet::mc_varst::const_iterator it=module.vars.begin(); |
147 | | - it!=module.vars.end(); it++) |
148 | | - if(it->second.type.id()!="submodule") |
| 146 | + for(auto &item : module.items) |
| 147 | + if(item.is_var() && item.expr.type().id() != "submodule") |
149 | 148 | { |
150 | 149 | symbol_tablet symbol_table; |
151 | 150 | namespacet ns{symbol_table}; |
152 | | - auto msg = type2smv(it->second.type, ns); |
153 | | - out << " " << it->first << ": " << msg << ";\n"; |
| 151 | + auto identifier = to_smv_identifier_expr(item.expr).identifier(); |
| 152 | + auto msg = type2smv(item.expr.type(), ns); |
| 153 | + out << " " << identifier << ": " << msg << ";\n"; |
154 | 154 | } |
155 | 155 |
|
156 | 156 | out << std::endl; |
157 | 157 |
|
158 | 158 | out << " SUBMODULES:" << std::endl; |
159 | 159 |
|
160 | | - for(smv_parse_treet::mc_varst::const_iterator |
161 | | - it=module.vars.begin(); |
162 | | - it!=module.vars.end(); it++) |
163 | | - if(it->second.type.id()=="submodule") |
| 160 | + for(auto &item : module.items) |
| 161 | + if(item.is_var() && item.expr.type().id() == "submodule") |
164 | 162 | { |
165 | 163 | symbol_tablet symbol_table; |
166 | 164 | namespacet ns(symbol_table); |
167 | | - auto msg = type2smv(it->second.type, ns); |
168 | | - out << " " << it->first << ": " << msg << ";\n"; |
| 165 | + auto identifier = to_smv_identifier_expr(item.expr).identifier(); |
| 166 | + auto msg = type2smv(item.expr.type(), ns); |
| 167 | + out << " " << identifier << ": " << msg << ";\n"; |
169 | 168 | } |
170 | 169 |
|
171 | 170 | out << std::endl; |
|
0 commit comments