#include <Descriptors.h>
Public Types | |
enum | DescriptorKind { DESC_Empty, DESC_Signature, DESC_Domain, DESC_Function, DESC_Procedure } |
typedef paramVector::iterator | paramIterator |
Public Member Functions | |
Descriptor (ParseClient *client, DescriptorKind kind=DESC_Empty) | |
void | clear () |
void | initialize (DescriptorKind descKind) |
void | release () |
Releases all Node's associated with this descriptor. | |
void | setIdentifier (IdentifierInfo *id, Location loc) |
Associates the given identifier and location with this descriptor. | |
DescriptorKind | getKind () const |
Returns the kind of this descriptor. | |
bool | isFunctionDescriptor () const |
Predicate functions for enquiering about this descriptors kind. | |
bool | isProcedureDescriptor () const |
bool | isSignatureDescriptor () const |
bool | isDomainDescriptor () const |
IdentifierInfo * | getIdInfo () const |
Retrives the identifier associated with this descriptor. | |
Location | getLocation () const |
Retrives the location associated with this descriptor. | |
bool | isValid () const |
bool | isInvalid () const |
void | setInvalid () |
void | addParam (Node param) |
unsigned | numParams () const |
bool | hasParams () const |
Returns true if parameters have been associated with this descriptor. | |
paramIterator | beginParams () |
paramIterator | endParams () |
void | setReturnType (Node node) |
Node | getReturnType () |
Definition at line 166 of file Descriptors.h.
typedef paramVector::iterator comma::Descriptor::paramIterator |
Definition at line 238 of file Descriptors.h.
DESC_Empty | Kind of uninitialized descriptors. |
DESC_Signature | Signature descriptors. |
DESC_Domain | Domain descriptors. |
DESC_Function | Function descriptors. |
DESC_Procedure | Procedure descriptors. |
Definition at line 174 of file Descriptors.h.
Descriptor::Descriptor | ( | ParseClient * | client, | |
DescriptorKind | kind = DESC_Empty | |||
) |
Creates a descriptor object of the given kind. The DescriptorKind argument defaults to DESC_Empty, meaning the descriptor type must be set (via a call to initialize) before it can be used.
Definition at line 59 of file Descriptors.cpp.
void comma::Descriptor::addParam | ( | Node | param | ) | [inline] |
Adds a Node to this descriptor representing the formal parameter of a model or subroutine.
Definition at line 229 of file Descriptors.h.
paramIterator comma::Descriptor::beginParams | ( | ) | [inline] |
Definition at line 239 of file Descriptors.h.
void Descriptor::clear | ( | ) |
Sets this Descriptor to an uninitialized state allowing it to be reused to represent a new element. On return, the kind of this descriptor is set to DESC_Empty.
Definition at line 85 of file Descriptors.cpp.
paramIterator comma::Descriptor::endParams | ( | ) | [inline] |
Definition at line 240 of file Descriptors.h.
IdentifierInfo* comma::Descriptor::getIdInfo | ( | ) | const [inline] |
Retrives the identifier associated with this descriptor.
Definition at line 218 of file Descriptors.h.
DescriptorKind comma::Descriptor::getKind | ( | ) | const [inline] |
Location comma::Descriptor::getLocation | ( | ) | const [inline] |
Retrives the location associated with this descriptor.
Definition at line 221 of file Descriptors.h.
Node Descriptor::getReturnType | ( | ) |
Accesses the return type of this descriptor. A call to this function is valid iff the descriptor denotes a function and setReturnType has been called. If these conditions do not hold then this method will assert.
Definition at line 76 of file Descriptors.cpp.
bool comma::Descriptor::hasParams | ( | ) | const [inline] |
Returns true if parameters have been associated with this descriptor.
Definition at line 236 of file Descriptors.h.
void comma::Descriptor::initialize | ( | DescriptorKind | descKind | ) | [inline] |
Clears the current state of this Descriptor and sets is type to the given kind.
Definition at line 194 of file Descriptors.h.
bool comma::Descriptor::isDomainDescriptor | ( | ) | const [inline] |
Definition at line 215 of file Descriptors.h.
bool comma::Descriptor::isFunctionDescriptor | ( | ) | const [inline] |
Predicate functions for enquiering about this descriptors kind.
Definition at line 212 of file Descriptors.h.
bool comma::Descriptor::isInvalid | ( | ) | const [inline] |
Definition at line 224 of file Descriptors.h.
bool comma::Descriptor::isProcedureDescriptor | ( | ) | const [inline] |
Definition at line 213 of file Descriptors.h.
bool comma::Descriptor::isSignatureDescriptor | ( | ) | const [inline] |
Definition at line 214 of file Descriptors.h.
bool comma::Descriptor::isValid | ( | ) | const [inline] |
Definition at line 223 of file Descriptors.h.
unsigned comma::Descriptor::numParams | ( | ) | const [inline] |
Returns the number of parameters currently associated with this descriptor.
Definition at line 233 of file Descriptors.h.
void Descriptor::release | ( | ) |
void comma::Descriptor::setIdentifier | ( | IdentifierInfo * | id, | |
Location | loc | |||
) | [inline] |
Associates the given identifier and location with this descriptor.
Definition at line 203 of file Descriptors.h.
void comma::Descriptor::setInvalid | ( | ) | [inline] |
Definition at line 225 of file Descriptors.h.
void Descriptor::setReturnType | ( | Node | node | ) |
Sets the return type of this descriptor. Return types can only be associated with function descriptors. This method will assert if this descriptor is of any other kind.
Definition at line 68 of file Descriptors.cpp.