40 result.reserve(src.
size());
55 if(expr.
id()==ID_symbol)
58 let_valuest::const_iterator v_it=
let_values.find(identifier);
61 else if(identifier==
"po")
64 else if(identifier==
"rf")
67 else if(identifier==
"co")
70 else if(identifier==
"loc")
73 else if(identifier==
"int")
76 else if(identifier==
"ext")
79 else if(identifier==
"id")
82 else if(identifier==
"R")
85 else if(identifier==
"W")
88 else if(identifier==
"F")
91 else if(identifier==
"B")
94 else if(identifier==
"RMW")
97 else if(identifier==
"rmw")
100 else if(identifier==
"IW")
103 else if(identifier==
"FW")
106 else if(identifier==
"M")
109 else if(identifier==
"addr")
112 else if(identifier==
"data")
115 else if(identifier==
"ctrl")
121 ": unknown identifier `"+
id2string(identifier)+
"'";
124 else if(expr.
id()==ID_union)
131 throw "acyclic cannot do "+expr.
id_string();
138 if(statement==ID_block)
145 else if(statement==ID_let)
148 const exprt &binding_list=code.
op0();
151 if(it->id()==
"valbinding")
153 assert(it->operands().size()==2);
154 if(it->op0().id()==ID_symbol)
160 throw "cannot do tuple valbinding";
162 else if(it->id()==
"funbinding")
164 throw "cannot do funbinding";
167 throw "unknown let binding";
170 else if(statement==
"check")
173 if(code.
op0().
id()==
"acyclic")
179 throw "can only do 'acyclic'";
186 out <<
"// Generated by mmcc\n";
193 out <<
" void operator()();\n";
206 const irept &instruction,
210 mm2cpp.model_name=model_name;
const irep_idt & get_statement() const
const std::string & id2string(const irep_idt &d)
void mm2cpp(const irep_idt &model_name, const irept &instruction, std::ostream &out)
const irep_idt & get_identifier() const
std::string as_string() const
void instruction2cpp(const codet &code, unsigned indent)
const irep_idt & id() const
API to expression classes.
Base class for tree-like data structures with sharing.
#define forall_operands(it, expr)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast a generic exprt to a symbol_exprt.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
std::map< irep_idt, exprt > let_valuest
static std::string text2c(const irep_idt &src)
Base class for all expressions.
void operator()(const irept &)
const source_locationt & source_location() const
void check_acyclic(const exprt &, unsigned indent)
const std::string & id_string() const
const codet & to_code(const exprt &expr)
mm2cppt(std::ostream &_out)
A statement in a programming language.