|
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 | #include "smv_types.h" |
@@ -68,11 +69,10 @@ void smv_languaget::dependencies( |
68 | 69 |
|
69 | 70 | const smv_parse_treet::modulet &smv_module=m_it->second; |
70 | 71 |
|
71 | | - for(smv_parse_treet::mc_varst::const_iterator it=smv_module.vars.begin(); |
72 | | - it!=smv_module.vars.end(); it++) |
73 | | - if(it->second.type.id() == ID_smv_submodule) |
| 72 | + for(auto &item : smv_module.items) |
| 73 | + if(item.is_var() && item.expr.type().id() == ID_smv_submodule) |
74 | 74 | module_set.insert( |
75 | | - id2string(to_smv_submodule_type(it->second.type).identifier())); |
| 75 | + id2string(to_smv_submodule_type(item.expr.type()).identifier())); |
76 | 76 | } |
77 | 77 |
|
78 | 78 | /*******************************************************************\ |
@@ -145,29 +145,28 @@ void smv_languaget::show_parse(std::ostream &out, message_handlert &) |
145 | 145 |
|
146 | 146 | out << " VARIABLES:" << std::endl; |
147 | 147 |
|
148 | | - for(smv_parse_treet::mc_varst::const_iterator it=module.vars.begin(); |
149 | | - it!=module.vars.end(); it++) |
150 | | - if(it->second.type.id() != ID_smv_submodule) |
| 148 | + for(auto &item : module.items) |
| 149 | + if(item.is_var() && item.expr.type().id() != ID_smv_submodule) |
151 | 150 | { |
152 | 151 | symbol_tablet symbol_table; |
153 | 152 | namespacet ns{symbol_table}; |
154 | | - auto msg = type2smv(it->second.type, ns); |
155 | | - out << " " << it->first << ": " << msg << ";\n"; |
| 153 | + auto identifier = to_smv_identifier_expr(item.expr).identifier(); |
| 154 | + auto msg = type2smv(item.expr.type(), ns); |
| 155 | + out << " " << identifier << ": " << msg << ";\n"; |
156 | 156 | } |
157 | 157 |
|
158 | 158 | out << std::endl; |
159 | 159 |
|
160 | 160 | out << " SUBMODULES:" << std::endl; |
161 | 161 |
|
162 | | - for(smv_parse_treet::mc_varst::const_iterator |
163 | | - it=module.vars.begin(); |
164 | | - it!=module.vars.end(); it++) |
165 | | - if(it->second.type.id() == ID_smv_submodule) |
| 162 | + for(auto &item : module.items) |
| 163 | + if(item.is_var() && item.expr.type().id() == ID_smv_submodule) |
166 | 164 | { |
167 | 165 | symbol_tablet symbol_table; |
168 | 166 | namespacet ns(symbol_table); |
169 | | - auto msg = type2smv(it->second.type, ns); |
170 | | - out << " " << it->first << ": " << msg << ";\n"; |
| 167 | + auto identifier = to_smv_identifier_expr(item.expr).identifier(); |
| 168 | + auto msg = type2smv(item.expr.type(), ns); |
| 169 | + out << " " << identifier << ": " << msg << ";\n"; |
171 | 170 | } |
172 | 171 |
|
173 | 172 | out << std::endl; |
|
0 commit comments