Commit 63da386a authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

ltl: use "final" and "override" in the AST classes

* src/ltlast/atomic_prop.hh, src/ltlast/binop.hh, src/ltlast/bunop.hh,
src/ltlast/constant.hh, src/ltlast/unop.hh: Here.
* src/misc/common.hh: Disable final for swig3.0.
parent 6f572ebc
......@@ -38,7 +38,7 @@ namespace spot
/// \ingroup ltl_ast
/// \brief Atomic propositions.
class SPOT_API atomic_prop : public formula
class SPOT_API atomic_prop final : public formula
{
public:
/// Build an atomic proposition with name \a name in
......@@ -46,7 +46,7 @@ namespace spot
static const atomic_prop*
instance(const std::string& name, environment& env);
virtual void accept(visitor& visitor) const;
virtual void accept(visitor& visitor) const override;
/// Get the name of the atomic proposition.
const std::string& name() const
......@@ -61,7 +61,7 @@ namespace spot
}
/// Return a canonic representation of the atomic proposition
virtual std::string dump() const;
virtual std::string dump() const override;
/// Number of instantiated atomic propositions. For debugging.
static unsigned instance_count();
......
......@@ -40,7 +40,7 @@ namespace spot
/// \ingroup ltl_ast
/// \brief Binary operator.
class SPOT_API binop : public formula
class SPOT_API binop final: public formula
{
public:
/// Different kinds of binary opertaors
......@@ -110,7 +110,7 @@ namespace spot
const formula* first,
const formula* second);
virtual void accept(visitor& v) const;
virtual void accept(visitor& v) const override;
/// Get the first operand.
const formula* first() const
......@@ -134,7 +134,7 @@ namespace spot
const char* op_name() const;
/// Return a canonic representation of the atomic proposition
virtual std::string dump() const;
virtual std::string dump() const override;
/// Number of instantiated binary operators. For debugging.
static unsigned instance_count();
......
......@@ -35,7 +35,7 @@ namespace spot
/// \ingroup ltl_ast
/// \brief Bounded unary operator.
class SPOT_API bunop : public formula
class SPOT_API bunop final : public formula
{
public:
enum type { Star };
......@@ -85,7 +85,7 @@ namespace spot
unsigned min = 0,
unsigned max = unbounded);
virtual void accept(visitor& v) const;
virtual void accept(visitor& v) const override;
/// Get the sole operand of this operator.
const formula* child() const
......@@ -120,7 +120,7 @@ namespace spot
const char* op_name() const;
/// Return a canonic representation of operation.
virtual std::string dump() const;
virtual std::string dump() const override;
/// Number of instantiated unary operators. For debugging.
static unsigned instance_count();
......
......@@ -32,11 +32,11 @@ namespace spot
/// \ingroup ltl_ast
/// \brief A constant (True or False)
class SPOT_API constant : public formula
class SPOT_API constant final : public formula
{
public:
enum type { False, True, EmptyWord };
virtual void accept(visitor& v) const;
virtual void accept(visitor& v) const override;
/// Return the value of the constant.
type val() const
......@@ -47,7 +47,7 @@ namespace spot
/// Return the value of the constant as a string.
const char* val_name() const;
virtual std::string dump() const;
virtual std::string dump() const override;
/// Get the sole instance of spot::ltl::constant::constant(True).
static constant* true_instance() { return &true_instance_; }
......
......@@ -36,7 +36,7 @@ namespace spot
/// \ingroup ltl_ast
/// \brief Unary operators.
class SPOT_API unop : public formula
class SPOT_API unop final : public formula
{
public:
enum type {
......@@ -87,7 +87,7 @@ namespace spot
/// handle this one as well.
static const formula* instance(type op, const formula* child);
virtual void accept(visitor& v) const;
virtual void accept(visitor& v) const override;
/// Get the sole operand of this operator.
const formula* child() const
......@@ -105,7 +105,7 @@ namespace spot
const char* op_name() const;
/// Return a canonic representation of the atomic proposition
virtual std::string dump() const;
virtual std::string dump() const override;
/// Number of instantiated unary operators. For debugging.
static unsigned instance_count();
......
......@@ -78,8 +78,11 @@
// Swig 2.0 does not understand '= delete'. This already
// works with the development version of Swig 3.
// Swig 3.0.2 still does not understand 'final' when used
// at class definition.
#ifdef SWIG
#define SPOT_DELETED
#define final
#else
#define SPOT_DELETED = delete
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment