- r_replacement_expr = iface_ref;
- }
- else
- {
- // Look for the variable in anonymous interface blocks.
- for(i=blocks.begin(); (!declaration && i!=blocks.end()); ++i)
- if(i->second->instance_name.empty() && i->second->struct_declaration)
- {
- const map<string, VariableDeclaration *> &iface_vars = i->second->struct_declaration->members.variables;
- map<string, VariableDeclaration *>::const_iterator j = iface_vars.find(var.name);
- if(j!=iface_vars.end())
- declaration = j->second;
- }
+
+ if(i->second->instance_name.empty())
+ {
+ iface_ref->name = format("%s %s", i->second->interface, i->second->block_name);
+
+ MemberAccess *memacc = new MemberAccess;
+ memacc->source = var.source;
+ memacc->line = var.line;
+ memacc->left = iface_ref;
+ memacc->member = var.name;
+
+ r_replacement_expr = memacc;
+ }
+ else
+ {
+ iface_ref->name = var.name;
+ r_replacement_expr = iface_ref;
+ }