diff options
author | ajreynol <andrew.j.reynolds@gmail.com> | 2016-02-15 13:38:51 -0600 |
---|---|---|
committer | ajreynol <andrew.j.reynolds@gmail.com> | 2016-02-15 13:38:51 -0600 |
commit | f31163c1f6bb1816365e9f22505d9558a7bc1802 (patch) | |
tree | 2ef3eadf500f51f90a9e7a45d4e0057336604fde /src/expr | |
parent | 62b673a6b8444c14c169a984dd6e3fc8f685851e (diff) |
Minor change to last commit
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/type.cpp | 46 | ||||
-rw-r--r-- | src/expr/type.h | 18 |
2 files changed, 32 insertions, 32 deletions
diff --git a/src/expr/type.cpp b/src/expr/type.cpp index 6a8e6609c..6b5bdf07c 100644 --- a/src/expr/type.cpp +++ b/src/expr/type.cpp @@ -292,29 +292,6 @@ bool Type::isRecord() const { return d_typeNode->isRecord(); } -/** Get the length of a tuple type */ -size_t Type::getTupleLength() const { - NodeManagerScope nms(d_nodeManager); - return d_typeNode->getTupleLength(); -} - -/** Get the constituent types of a tuple type */ -std::vector<Type> Type::getTupleTypes() const { - NodeManagerScope nms(d_nodeManager); - std::vector< TypeNode > vec = d_typeNode->getTupleTypes(); - std::vector< Type > vect; - for( unsigned i=0; i<vec.size(); i++ ){ - vect.push_back( vec[i].toType() ); - } - return vect; -} - -/** Get the description of the record type */ -const Record& Type::getRecord() const { - NodeManagerScope nms(d_nodeManager); - return d_typeNode->getRecord(); -} - /** Is this a symbolic expression type? */ bool Type::isSExpr() const { NodeManagerScope nms(d_nodeManager); @@ -632,6 +609,29 @@ DatatypeType DatatypeType::instantiate(const std::vector<Type>& params) const { return DatatypeType(makeType(d_nodeManager->mkTypeNode(kind::PARAMETRIC_DATATYPE, paramsNodes))); } +/** Get the length of a tuple type */ +size_t DatatypeType::getTupleLength() const { + NodeManagerScope nms(d_nodeManager); + return d_typeNode->getTupleLength(); +} + +/** Get the constituent types of a tuple type */ +std::vector<Type> DatatypeType::getTupleTypes() const { + NodeManagerScope nms(d_nodeManager); + std::vector< TypeNode > vec = d_typeNode->getTupleTypes(); + std::vector< Type > vect; + for( unsigned i=0; i<vec.size(); i++ ){ + vect.push_back( vec[i].toType() ); + } + return vect; +} + +/** Get the description of the record type */ +const Record& DatatypeType::getRecord() const { + NodeManagerScope nms(d_nodeManager); + return d_typeNode->getRecord(); +} + DatatypeType SelectorType::getDomain() const { return DatatypeType(makeType((*d_typeNode)[0])); } diff --git a/src/expr/type.h b/src/expr/type.h index b7ea14f78..67d259fec 100644 --- a/src/expr/type.h +++ b/src/expr/type.h @@ -300,15 +300,6 @@ public: */ bool isRecord() const; - /** Get the length of a tuple type */ - size_t getTupleLength() const; - - /** Get the constituent types of a tuple type */ - std::vector<Type> getTupleTypes() const; - - /** Get the description of the record type */ - const Record& getRecord() const; - /** * Is this a symbolic expression type? * @return true if the type is a symbolic expression type @@ -679,6 +670,15 @@ public: /** Instantiate a datatype using this datatype constructor */ DatatypeType instantiate(const std::vector<Type>& params) const; + /** Get the length of a tuple type */ + size_t getTupleLength() const; + + /** Get the constituent types of a tuple type */ + std::vector<Type> getTupleTypes() const; + + /** Get the description of the record type */ + const Record& getRecord() const; + };/* class DatatypeType */ /** |