PPL  1.2
Concrete_Expression_defs.hh
Go to the documentation of this file.
1 /* Concrete_Expression class declaration.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Concrete_Expression_defs_hh
25 #define PPL_Concrete_Expression_defs_hh 1
26 
28 #include "globals_defs.hh"
29 #include "Interval_defs.hh"
30 
31 namespace Parma_Polyhedra_Library {
32 
35 public:
44 
50 
55  bool is_bounded_integer() const;
56 
61  bool is_floating_point() const;
62 
71 
81 
91 
99 
101  bool OK() const;
102 
103 private:
105  struct Implementation {
106  bool bounded_integer:1;
107  unsigned int bounded_integer_type_width:23;
108  unsigned int bounded_integer_type_representation:2;
109  unsigned int bounded_integer_type_overflow:2;
110  unsigned int floating_point_format:4;
111  };
112 
115 
118 };
119 
121 template <typename Target>
123 public:
126 
129 
131  template <template <typename T> class Derived>
132  bool is() const;
133 
138  template <template <typename T> class Derived>
139  Derived<Target>* as();
140 
145  template <template <typename T> class Derived>
146  const Derived<Target>* as() const;
147 
148 };
149 
151 template <typename Target>
153 public:
156 
159 
162 };
163 
165 template <typename Target>
167 public:
170 
172  const Concrete_Expression<Target>* argument() const;
173 };
174 
176 template <typename Target>
179  const Concrete_Expression<Target>* argument() const;
180 };
181 
183 template <typename Target>
185 };
186 
188 template <typename Target>
190 };
191 
193 template <typename Target>
195 };
196 
197 } // namespace Parma_Polyhedra_Library
198 
200 
201 #endif // !defined(PPL_Concrete_Expression_defs_hh)
const Concrete_Expression< Target > * right_hand_side() const
Returns the right-hand side of *this.
int Concrete_Expression_BOP
Encodes a binary operator of concrete expressions.
const Concrete_Expression< Target > * argument() const
Returns the casted expression.
bool is_bounded_integer() const
Returns true if and only if *this is a bounded integer type.
Base class for binary operator applied to two concrete expressions.
bool is() const
Tests if *this has the same kind as Derived.
Bounded_Integer_Type_Overflow bounded_integer_type_overflow() const
Returns the overflow behavior of the bounded integer type encoded by *this.
Concrete_Expression_BOP binary_operator() const
Returns a constant identifying the operator of *this.
Concrete_Expression_Type(Implementation implementation)
Constructor from implementation.
Base class for cast operator concrete expressions.
const Concrete_Expression< Target > * argument() const
Returns the argument *this.
Base class for integer constant concrete expressions.
const Concrete_Expression< Target > * left_hand_side() const
Returns the left-hand side of *this.
Bounded_Integer_Type_Width bounded_integer_type_width() const
Returns the width in bits of the bounded integer type encoded by *this.
Base class for floating-point constant concrete expression.
Bounded_Integer_Type_Representation bounded_integer_type_representation() const
Returns the representation of the bounded integer type encoded by *this.
Concrete_Expression_Type type() const
Returns the type of \* this.
static Concrete_Expression_Type bounded_integer(Bounded_Integer_Type_Width width, Bounded_Integer_Type_Representation representation, Bounded_Integer_Type_Overflow overflow)
Returns the bounded integer type corresponding to width, representation and overflow.
Concrete_Expression_Kind kind() const
Returns the kind of \* this.
bool is_floating_point() const
Returns true if and only if *this is a floating point type.
int Concrete_Expression_Kind
Encodes the kind of concrete expression.
The base class of all concrete expressions.
static Concrete_Expression_Type floating_point(Floating_Point_Format format)
Returns the floating point type corresponding to format.
The entire library is confined to this namespace.
Definition: version.hh:61
Derived< Target > * as()
Returns a pointer to *this converted to type Derived*.
Base class for references to some approximable.
bool OK() const
Checks if all the invariants are satisfied.
Floating_Point_Format floating_point_format() const
Returns the format of the floating point type encoded by *this.
Concrete_Expression_UOP unary_operator() const
Returns a constant identifying the operator of *this.
Base class for unary operator applied to one concrete expression.
int Concrete_Expression_UOP
Encodes a unary operator of concrete expressions.