cout << a << endl;
}
cout << "Node size is: ";
- cout << NodeSize(a) << endl << endl;
+ cout << NodeSize(a) << endl;
}
unsigned int BeevMgr::NodeSize(const ASTNode& a, bool clearStatInfo)
//record that you have seen this node already
StatInfoSet.insert(a);
+ // cout << "Number of bytes per Node is: ";
+ // cout << sizeof(*(a._int_node_ptr)) << endl;
//leaf node has a size of 1
if (a.Degree() == 0)
class ASTBVConst;
class BVSolver;
+
+ template <class E, class T>
+ struct enumeration
+ {
+ typedef T type;
+ typedef E enum_type;
+
+ enumeration()
+ : e_(E())
+ {}
+
+ enumeration(E e)
+ : e_(static_cast<T>(e))
+ {}
+
+ operator E() const
+ { return static_cast<E>(e_); }
+
+ private:
+ T e_;
+ };
+
//Useful typedefs: Vector of ASTNodes, used for child nodes among
//other things.
typedef vector<ASTNode> ASTVec;
int indentation = 0);
private:
- // FIXME: make this into a reference?
ASTInternal * _int_node_ptr; // The real data.
// Usual constructor.
int _ref_count;
// Kind. It's a type tag and the operator.
- Kind _kind;
+ //Kind _kind;
+ enumeration<Kind,unsigned char> _kind;
// The vector of children (*** should this be in ASTInterior? ***)
ASTVec _children;
// Length of bitvector type for array index. The term is an
// array iff this is positive. Otherwise, the term is a bitvector
// or a bit.
- unsigned int _index_width;
+ unsigned short _index_width;
// Length of bitvector type for scalar value or array element.
// If this is one, the term represents a single bit (same as a bitvector
// of length 1). It must be 1 or greater.
- unsigned int _value_width;
+ unsigned short _value_width;
// Increment refcount.
void IncRef()