From dae3410dcd933062563d4046db5b4be80cff644b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 3 Feb 2015 14:28:18 +0100 Subject: [PATCH] vhdlpp: Variable::write_to_stream(). --- vhdlpp/vsignal.cc | 7 +++++++ vhdlpp/vsignal.h | 1 + 2 files changed, 8 insertions(+) diff --git a/vhdlpp/vsignal.cc b/vhdlpp/vsignal.cc index 3f5baa706..94bd8959b 100644 --- a/vhdlpp/vsignal.cc +++ b/vhdlpp/vsignal.cc @@ -77,3 +77,10 @@ int Variable::emit(ostream&out, Entity*, ScopeBase*) out << ";" << endl; return errors; } + +void Variable::write_to_stream(std::ostream&fd) +{ + fd << "variable " << peek_name() << " : "; + peek_type()->write_to_stream(fd); + fd << ";" << endl; +} diff --git a/vhdlpp/vsignal.h b/vhdlpp/vsignal.h index 9d1464560..d2bfdbcd0 100644 --- a/vhdlpp/vsignal.h +++ b/vhdlpp/vsignal.h @@ -80,6 +80,7 @@ class Variable : public SigVarBase { Variable(perm_string name, const VType*type); int emit(ostream&out, Entity*ent, ScopeBase*scope); + void write_to_stream(std::ostream&fd); }; inline void SigVarBase::count_ref_sequ()