inst.hh 507 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef INST_INST_HH
# define INST_INST_HH

# include <iostream>

# include "inst/visitor.hh"

namespace inst
{
  
  class Inst
  {
  public:
    virtual ~Inst()
    {
    }

  public:
    virtual void	accept (ConstVisitor& v) const = 0;
    virtual void	accept (Visitor& v) = 0;

  public:
    virtual void	print(std::ostream&) const = 0;
  };

  inline std::ostream&
  operator<<(std::ostream& ostr, const Inst& i)
  {
    i.print(ostr);
    return ostr;
  }

} // namespace inst

#endif // !INST_INST_HH