clone.hh 914 Bytes
Newer Older
1
2
3
4
5
6
#ifndef SPOT_LTLVISIT_CLONE_HH
# define SPOT_LTLVISIT_CLONE_HH

#include "ltlast/formula.hh"
#include "ltlast/visitor.hh"

7
namespace spot
8
9
10
{
  namespace ltl
  {
11
12
13
14
15
16
    /// \brief Clone a formula.
    ///
    /// This visitor is public, because it's convenient
    /// to derive from it and override part of its methods.
    /// But if you just want the functionality, consider using
    /// spot::ltl::clone instead.
17
    class clone_visitor : public visitor
18
19
20
21
22
23
    {
    public:
      clone_visitor();
      virtual ~clone_visitor();

      formula* result() const;
24
25
26
27
28
29
30
31
32

      void visit(atomic_prop* ap);
      void visit(unop* uo);
      void visit(binop* bo);
      void visit(multop* mo);
      void visit(constant* c);

      virtual formula* recurse(formula* f);

33
34
35
36
    protected:
      formula* result_;
    };

37
    /// \brief Clone a formula.
38
    formula* clone(formula* f);
39
40
41
42
  }
}

#endif // SPOT_LTLVISIT_LUNABBREV_HH