LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
comment.hxx
Go to the documentation of this file.
1 
5 #ifndef ASSEM_COMMENT_HXX
6 # define ASSEM_COMMENT_HXX
7 
8 # include <sstream>
9 # include <ostream>
10 # include <assem/comment.hh>
11 
12 namespace assem
13 {
14  inline
15  Comment::Comment(const std::string& comment)
16  : Instr(comment)
17  {
18  }
19 
20  inline
21  std::ostream&
22  Comment::print(std::ostream& ostr) const
23  {
24  std::string s;
25  std::istringstream icomment(this->assem_);
26 
27  while (not icomment.eof())
28  {
29  getline(icomment, s);
30  ostr << "\t# " << s;
31  }
32  return ostr;
33  }
34 
35 } // namespace assem
36 
37 #endif // !ASSEM_COMMENT_HXX