Add vhdl_element::print method for debugging

This commit is contained in:
Nick Gasson 2008-07-01 10:44:20 +01:00
parent 050aa277ae
commit ef89a760d6
3 changed files with 13 additions and 2 deletions

View File

@ -64,8 +64,12 @@ static vhdl_expr *nexus_to_expr(vhdl_scope *arch_scope, ivl_nexus_t nexus)
}
vhdl_var_ref *nexus_to_var_ref(vhdl_scope *arch_scope, ivl_nexus_t nexus)
{
vhdl_var_ref *ref = dynamic_cast<vhdl_var_ref*>(nexus_to_expr(arch_scope, nexus));
{
vhdl_expr *e = nexus_to_expr(arch_scope, nexus);
e->print();
vhdl_var_ref *ref = dynamic_cast<vhdl_var_ref*>(e);
assert(ref);
return ref;
}

View File

@ -72,3 +72,9 @@ void vhdl_element::emit_comment(std::ostream &of, int level,
newline(of, level);
}
}
void vhdl_element::print() const
{
emit(std::cout, 0);
std::cout << std::endl;
}

View File

@ -35,6 +35,7 @@ public:
virtual ~vhdl_element() {}
virtual void emit(std::ostream &of, int level=0) const = 0;
void print() const;
void set_comment(std::string comment);
protected: