binop.cc 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
#include <cassert>
#include "binop.hh"
#include "visitor.hh"

namespace spot
{
  namespace ltl
  {    
9
    binop::binop(type op, formula* first, formula* second)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
      : op_(op), first_(first), second_(second)
    {
    }

    binop::~binop()
    {
    }

    void
    binop::accept(visitor& v)
    {
      v.visit(this);
    }

    void
    binop::accept(const_visitor& v) const
    {
      v.visit(this);
    }

30
    const formula*
31
32
33
34
35
    binop::first() const
    {
      return first_;
    }

36
    formula*
37
38
39
40
41
    binop::first()
    {
      return first_;
    }

42
    const formula*
43
44
45
46
47
    binop::second() const
    {
      return second_;
    }

48
    formula* 
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
    binop::second()
    {
      return second_;
    }

    binop::type 
    binop::op() const
    {
      return op_;
    }

    const char* 
    binop::op_name() const
    {
      switch (op_)
	{
	case Xor:
	  return "Xor";
	case Implies:
	  return "Implies";
	case Equiv:
	  return "Equiv";
	case U:
	  return "U";
	case R:
	  return "R";
	}
      // Unreachable code.
      assert(0);
      return 0;
    }

  }
}