clone.hh 2.32 KB
Newer Older
1
2
3
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
Guillaume Sadegh's avatar
Guillaume Sadegh committed
4
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
5
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
6
7
8
9
10
11
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation; either version 3 of the License, or
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
13
14
15
16
17
18
19
20
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
22

23
24
25
26
#ifndef SPOT_LTLVISIT_CLONE_HH
# define SPOT_LTLVISIT_CLONE_HH

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

29
namespace spot
30
31
32
{
  namespace ltl
  {
33
    /// \ingroup ltl_visitor
34
    /// \brief Clone a formula.
35
36
37
38
    ///
    /// 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
39
    /// spot::ltl::formula::clone instead, it is way faster.
40
    class clone_visitor : public visitor
41
42
43
44
45
    {
    public:
      clone_visitor();
      virtual ~clone_visitor();

46
      const formula* result() const;
47

48
49
50
51
52
53
54
      void visit(const atomic_prop* ap);
      void visit(const unop* uo);
      void visit(const binop* bo);
      void visit(const automatop* mo);
      void visit(const multop* mo);
      void visit(const constant* c);
      void visit(const bunop* c);
55

56
      virtual const formula* recurse(const formula* f);
57

58
    protected:
59
      const formula* result_;
60
61
    };

62
#if __GNUC__
63
    /// \ingroup ltl_essential
64
    /// \brief Clone a formula.
65
    /// \deprecated Use f->clone() instead.
66
    const formula* clone(const formula* f) __attribute__ ((deprecated));
67
68
#else
    /// \ingroup ltl_essential
69
    /// \brief Clone a formula.
70
    /// \deprecated Use f->clone() instead.
71
    const formula* clone(const formula* f);
72
#endif
73
74
75
76
  }
}

#endif // SPOT_LTLVISIT_LUNABBREV_HH