comma::PrimaryType Class Reference

#include <Type.h>

Inheritance diagram for comma::PrimaryType:
Inheritance graph
[legend]
Collaboration diagram for comma::PrimaryType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool isSubtype () const
 Returns true if this node denotes a subtype.
bool isRootType () const
 Returns true if this node denotes a root type.
bool isDerivedType () const
 Returns true if this is a derived type.
virtual bool isConstrained () const
bool isUnconstrained () const
 Returns true if this type is unconstrained.
bool isSubtypeOf (const PrimaryType *type) const



const PrimaryTypegetRootType () const
PrimaryTypegetRootType ()
PrimaryTypegetParentType ()
 Returns the parent type of this type, or null if isDerivedType() returns false.
const PrimaryTypegetParentType () const
const PrimaryTypegetAncestorType () const
 Returns the first ancestor type of this type, or null if this is a root type without a parent.
PrimaryTypegetAncestorType ()

Static Public Member Functions

static bool classof (const PrimaryType *node)
 Support isa and dyn_cast.
static bool classof (const Ast *node)

Protected Member Functions

 PrimaryType (AstKind kind, PrimaryType *rootOrParent, bool subtype)

Detailed Description

The PrimaryType class forms the principle root of the type hierarchy. Most type nodes inherit from PrimaryType, with the notable exception of SubroutineType.

Definition at line 328 of file Type.h.


Constructor & Destructor Documentation

comma::PrimaryType::PrimaryType ( AstKind  kind,
PrimaryType rootOrParent,
bool  subtype 
) [inline, protected]

Protected constructor for primary types.

Parameters:
kind The concrete kind tag for this node.
rootOrParent If this is to represent a root type, then this argument is a pointer to the parent type or null. If this is to represent a subtype, then rootOrParent should point to the type of this subtype.
subtype When true, the type under construction is a subtype. When false, the type is a root type.

Definition at line 418 of file Type.h.


Member Function Documentation

static bool comma::PrimaryType::classof ( const Ast node  )  [inline, static]
static bool comma::PrimaryType::classof ( const PrimaryType node  )  [inline, static]
PrimaryType* comma::PrimaryType::getAncestorType (  )  [inline]

Returns the root type of this type. If this is a root type, returns a pointer to this, otherwise the type of this subtype is returned.

Definition at line 376 of file Type.h.

const PrimaryType* comma::PrimaryType::getAncestorType (  )  const [inline]

Returns the first ancestor type of this type, or null if this is a root type without a parent.

Definition at line 373 of file Type.h.

const PrimaryType* comma::PrimaryType::getParentType (  )  const [inline]

Returns the root type of this type. If this is a root type, returns a pointer to this, otherwise the type of this subtype is returned.

Definition at line 364 of file Type.h.

PrimaryType* comma::PrimaryType::getParentType (  )  [inline]

Returns the parent type of this type, or null if isDerivedType() returns false.

Definition at line 360 of file Type.h.

PrimaryType* comma::PrimaryType::getRootType (  )  [inline]

Returns the root type of this type. If this is a root type, returns a pointer to this, otherwise the type of this subtype is returned.

Reimplemented in comma::IncompleteType, comma::DomainType, comma::DiscreteType, comma::EnumerationType, comma::IntegerType, comma::ArrayType, comma::RecordType, and comma::AccessType.

Definition at line 343 of file Type.h.

const PrimaryType* comma::PrimaryType::getRootType (  )  const [inline]

Returns the root type of this type. If this is a root type, returns a pointer to this, otherwise the type of this subtype is returned.

Reimplemented in comma::IncompleteType, comma::DomainType, comma::DiscreteType, comma::EnumerationType, comma::IntegerType, comma::ArrayType, comma::RecordType, and comma::AccessType.

Definition at line 340 of file Type.h.

virtual bool comma::PrimaryType::isConstrained (  )  const [inline, virtual]

Returns true if this type is constrained.

Note:
Default implementation returns false.

Reimplemented in comma::EnumerationType, comma::IntegerType, comma::ArrayType, and comma::RecordType.

Definition at line 382 of file Type.h.

bool comma::PrimaryType::isDerivedType (  )  const [inline]

Returns true if this is a derived type.

Definition at line 352 of file Type.h.

bool comma::PrimaryType::isRootType (  )  const [inline]

Returns true if this node denotes a root type.

Definition at line 335 of file Type.h.

bool comma::PrimaryType::isSubtype (  )  const [inline]

Returns true if this node denotes a subtype.

Definition at line 332 of file Type.h.

bool comma::PrimaryType::isSubtypeOf ( const PrimaryType type  )  const [inline]

Returns true if this type is a subtype of the given type.

All types are considered to be subtypes of themselves.

Definition at line 390 of file Type.h.

bool comma::PrimaryType::isUnconstrained (  )  const [inline]

Returns true if this type is unconstrained.

Definition at line 385 of file Type.h.


The documentation for this class was generated from the following file:

Generated on 1 Feb 2010 for Comma by  doxygen 1.6.1

Rabisu Mirror Service We provide mirrors to support Open source communities. Our mirror server is located in Istanbul/Turkey region.

Please do not hesitate to contact mirror@rabisu.com for new open source mirror submissions.