comma::TypeRef Class Reference
#include <TypeRef.h>
List of all members.
Public Member Functions |
| TypeRef (Location loc, FunctorDecl *functor) |
| Creates an incomplete reference to the given functor.
|
| TypeRef (Location loc, VarietyDecl *variety) |
| Creates a incomplete reference to the given variety.
|
| TypeRef (Location loc, SigInstanceDecl *instance) |
| Creates a complete reference to the given signature instance.
|
| TypeRef (Location loc, TypeDecl *tyDecl) |
| Creates a complete reference to the given type declaration.
|
Location | getLocation () const |
| Returns the location of this reference.
|
IdentifierInfo * | getIdInfo () const |
| Returns the IdentifierInfo of the underlying decl.
|
bool | isIncomplete () const |
| Returns true if this is a incomplete reference.
|
bool | isComplete () const |
| Returns true if this is a complete reference.
|
bool | referencesVariety () const |
| Returns true if this is an incomplete variety reference.
|
bool | referencesFunctor () const |
| Returns true if this is an incomplete functor reference.
|
bool | referencesSigInstance () const |
| Returns true if this is a complete reference to a signature instance.
|
bool | referencesTypeDecl () const |
| Returns true if this is a complete reference to a TypeDecl.
|
Decl * | getDecl () const |
| Returns the referenced declaration.
|
ModelDecl * | getModelDecl () const |
VarietyDecl * | getVarietyDecl () const |
| If this references a variety, return it, else null.
|
FunctorDecl * | getFunctorDecl () const |
| If this references a functor, return it, else null.
|
SigInstanceDecl * | getSigInstanceDecl () const |
| If this references a signature instance, return it, else null.
|
TypeDecl * | getTypeDecl () const |
| If this references a type declaration, return it, else null.
|
Static Public Member Functions |
static bool | classof (const TypeRef *node) |
| Support isa and dyn_cast.
|
static bool | classof (const Ast *node) |
Detailed Description
The TypeRef class is a miscellaneous AST node, meaning that it does not belong to any of the major AST hierarchy branches. It is a thin wrapper around a specific named type, associating a location with the reference.
A TypeRef is said to be `incomplete' if the ref names a parameterized type such as a Variety or Functor. A `complete' ref is one which names a non-parameterized type, or a fully applied instance of a parameterized type.
These nodes are transient and do not find a home in the final AST. They are created to hold information about references to type declarations while the type checker is being driven by the parser.
Definition at line 33 of file TypeRef.h.
Constructor & Destructor Documentation
Creates an incomplete reference to the given functor.
Definition at line 37 of file TypeRef.h.
Creates a incomplete reference to the given variety.
Definition at line 41 of file TypeRef.h.
Creates a complete reference to the given signature instance.
Definition at line 45 of file TypeRef.h.
Creates a complete reference to the given type declaration.
Definition at line 49 of file TypeRef.h.
Member Function Documentation
static bool comma::TypeRef::classof |
( |
const Ast * |
node |
) |
[inline, static] |
static bool comma::TypeRef::classof |
( |
const TypeRef * |
node |
) |
[inline, static] |
Decl* comma::TypeRef::getDecl |
( |
|
) |
const [inline] |
Returns the referenced declaration.
Definition at line 87 of file TypeRef.h.
FunctorDecl* comma::TypeRef::getFunctorDecl |
( |
|
) |
const [inline] |
If this references a functor, return it, else null.
Definition at line 101 of file TypeRef.h.
Location comma::TypeRef::getLocation |
( |
|
) |
const [inline, virtual] |
Returns the location of this reference.
Reimplemented from comma::Ast.
Definition at line 53 of file TypeRef.h.
ModelDecl* comma::TypeRef::getModelDecl |
( |
|
) |
const [inline] |
If this references a variety or functor, return it as a general ModelDecl, else null.
Definition at line 91 of file TypeRef.h.
If this references a signature instance, return it, else null.
Definition at line 106 of file TypeRef.h.
TypeDecl* comma::TypeRef::getTypeDecl |
( |
|
) |
const [inline] |
If this references a type declaration, return it, else null.
Definition at line 111 of file TypeRef.h.
VarietyDecl* comma::TypeRef::getVarietyDecl |
( |
|
) |
const [inline] |
If this references a variety, return it, else null.
Definition at line 96 of file TypeRef.h.
bool comma::TypeRef::isComplete |
( |
|
) |
const [inline] |
Returns true if this is a complete reference.
Definition at line 64 of file TypeRef.h.
bool comma::TypeRef::isIncomplete |
( |
|
) |
const [inline] |
Returns true if this is a incomplete reference.
Definition at line 59 of file TypeRef.h.
bool comma::TypeRef::referencesFunctor |
( |
|
) |
const [inline] |
Returns true if this is an incomplete functor reference.
Definition at line 72 of file TypeRef.h.
bool comma::TypeRef::referencesSigInstance |
( |
|
) |
const [inline] |
Returns true if this is a complete reference to a signature instance.
Definition at line 77 of file TypeRef.h.
bool comma::TypeRef::referencesTypeDecl |
( |
|
) |
const [inline] |
Returns true if this is a complete reference to a TypeDecl.
Definition at line 82 of file TypeRef.h.
bool comma::TypeRef::referencesVariety |
( |
|
) |
const [inline] |
Returns true if this is an incomplete variety reference.
Definition at line 67 of file TypeRef.h.
The documentation for this class was generated from the following file: