Add vhdl_element::print method for debugging
This commit is contained in:
parent
050aa277ae
commit
ef89a760d6
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue