#include <ParseClient.h>
Public Member Functions | |
Node | getNullNode () |
Node | getInvalidNode () |
virtual void | deleteNode (Node &node)=0 |
virtual void | acceptFormalDomain (IdentifierInfo *name, Location loc, Node sig)=0 |
virtual void | acceptSupersignature (Node typeNode)=0 |
Called for each super signature defined in a signature profile. | |
virtual void | beginAddExpression ()=0 |
virtual void | endAddExpression ()=0 |
Completes an add expression. | |
virtual void | acceptCarrier (IdentifierInfo *name, Location loc, Node typeNode)=0 |
Invoked when the parser consumes a carrier declaration. | |
virtual Node | acceptNullStmt (Location loc)=0 |
Called to notify the client of a null statement at the given position. | |
virtual bool | acceptStmt (Node context, Node stmt)=0 |
virtual bool | acceptObjectDeclaration (Location loc, IdentifierInfo *name, Node type, Node initializer)=0 |
virtual bool | acceptRenamedObjectDeclaration (Location loc, IdentifierInfo *name, Node type, Node target)=0 |
virtual Node | acceptPercent (Location loc)=0 |
virtual Node | acceptProcedureCall (Node name)=0 |
virtual Node | acceptInj (Location loc, Node expr)=0 |
virtual Node | acceptPrj (Location loc, Node expr)=0 |
virtual Node | acceptIntegerLiteral (llvm::APInt &value, Location loc)=0 |
virtual Node | acceptStringLiteral (const char *string, unsigned len, Location loc)=0 |
virtual Node | acceptNullExpr (Location loc)=0 |
virtual Node | acceptAllocatorExpr (Node operand, Location loc)=0 |
virtual Node | acceptQualifiedExpr (Node qualifier, Node operand)=0 |
virtual Node | acceptDereference (Node prefix, Location loc)=0 |
virtual bool | acceptImportDeclaration (Node importedType)=0 |
Submits an import from the given type node. | |
virtual Node | acceptIfStmt (Location loc, Node condition, NodeVector &consequents)=0 |
virtual Node | acceptElseStmt (Location loc, Node ifNode, NodeVector &alternates)=0 |
virtual Node | acceptElsifStmt (Location loc, Node ifNode, Node condition, NodeVector &consequents)=0 |
virtual Node | acceptEmptyReturnStmt (Location loc)=0 |
virtual Node | acceptReturnStmt (Location loc, Node retNode)=0 |
virtual Node | acceptAssignmentStmt (Node target, Node value)=0 |
virtual Node | acceptWhileStmt (Location loc, Node condition, NodeVector &stmtNodes)=0 |
Called to inform the client of a while statement. | |
virtual Node | acceptLoopStmt (Location loc, NodeVector &stmtNodes)=0 |
Called to inform the client of a loop statement. | |
virtual Node | acceptRaiseStmt (Location loc, Node exception, Node message)=0 |
virtual Node | acceptPragmaStmt (IdentifierInfo *name, Location loc, NodeVector &pragmaArgs)=0 |
Called when a pragma is encountered within a sequence of statements. | |
virtual void | acceptPragmaImport (Location pragmaLoc, IdentifierInfo *convention, Location conventionLoc, IdentifierInfo *enity, Location entityLoc, Node externalNameNode)=0 |
virtual void | acceptIntegerTypeDecl (IdentifierInfo *name, Location loc, Node low, Node high)=0 |
virtual void | acceptRangedSubtypeDecl (IdentifierInfo *name, Location loc, Node subtype, Node low, Node high)=0 |
virtual void | acceptSubtypeDecl (IdentifierInfo *name, Location loc, Node subtype)=0 |
virtual void | acceptIncompleteTypeDecl (IdentifierInfo *name, Location loc)=0 |
virtual void | acceptAccessTypeDecl (IdentifierInfo *name, Location loc, Node subtype)=0 |
Called to notify the client of an access type declaration. | |
virtual void | acceptArrayDecl (IdentifierInfo *name, Location loc, NodeVector indices, Node component)=0 |
Communicates an array type declaration. | |
Initial Callbacks. | |
virtual void | beginCapsule ()=0 |
virtual void | endCapsule ()=0 |
Generic Formal Delimiters. | |
virtual void | beginGenericFormals ()=0 |
virtual void | endGenericFormals ()=0 |
Capsule Callbacks. | |
virtual void | beginDomainDecl (IdentifierInfo *name, Location loc)=0 |
virtual void | beginSignatureDecl (IdentifierInfo *name, Location loc)=0 |
Signature Profile Delimiters | |
virtual void | beginSignatureProfile ()=0 |
virtual void | endSignatureProfile ()=0 |
Subroutine Declaration Callbacks. | |
When a subroutine declaration is about to be parsed, either beginFunctionDeclaration or beginProcedureDeclaration is invoked to inform the client of the kind and name of the upcomming subroutine. Once the declaration has been processed, the context is terminated with a call to endSubroutineDeclaration. | |
virtual void | beginFunctionDeclaration (IdentifierInfo *name, Location loc)=0 |
virtual void | beginProcedureDeclaration (IdentifierInfo *name, Location loc)=0 |
virtual void | acceptFunctionReturnType (Node typeNode)=0 |
virtual void | acceptSubroutineParameter (IdentifierInfo *formal, Location loc, Node typeNode, PM::ParameterMode mode)=0 |
virtual Node | endSubroutineDeclaration (bool definitionFollows)=0 |
Subroutine Definition Callbacks. | |
virtual Node | beginSubroutineDefinition (Node declarationNode)=0 |
virtual void | endSubroutineBody (Node context)=0 |
virtual void | endSubroutineDefinition ()=0 |
Name Callbacks | |
virtual Node | acceptDirectName (IdentifierInfo *name, Location loc, bool forStatement)=0 |
virtual Node | acceptCharacterLiteral (IdentifierInfo *lit, Location loc)=0 |
virtual Node | acceptSelectedComponent (Node prefix, IdentifierInfo *name, Location loc, bool forStatement)=0 |
virtual Node | acceptParameterAssociation (IdentifierInfo *key, Location loc, Node rhs)=0 |
virtual Node | acceptApplication (Node prefix, NodeVector &argumentNodes)=0 |
virtual Node | acceptAttribute (Node prefix, IdentifierInfo *name, Location loc)=0 |
virtual Node | finishName (Node name)=0 |
Aggregate Callbacks. | |
Processing of an aggregate expresion is bracketed by calls to beginAggregate and endAggregate. First, each positional component of the aggregate is processed and the client is notified with a call to acceptPositionalAggregateComponent. Next, every keyed component is processed. This is a two stage affair. For each key one of the acceptAggregateKey methods is invoked. Finally, acceptKeyedAggregateComponent is called with a NodeVector containing each key along with the associated expression. Finally, if the aggregate contains an others clause acceptAggregateOthers is called. | |
virtual void | beginAggregate (Location loc)=0 |
virtual void | acceptPositionalAggregateComponent (Node component)=0 |
Provides a Node describing a positional component of the aggregate. | |
virtual Node | acceptAggregateKey (Node lower, Node upper)=0 |
Called to indicate an aggregate key in the form of a range. | |
virtual Node | acceptAggregateKey (Node key)=0 |
virtual Node | acceptAggregateKey (IdentifierInfo *name, Location loc)=0 |
Called to indicate an aggregate key consisting of a single identifier. | |
virtual void | acceptKeyedAggregateComponent (NodeVector &keys, Node expr, Location loc)=0 |
virtual void | acceptAggregateOthers (Location loc, Node component)=0 |
virtual Node | endAggregate ()=0 |
For Statement Callbacks. | |
A | |
virtual Node | beginForStmt (Location loc, IdentifierInfo *iterName, Location iterLoc, Node control, bool isReversed)=0 |
virtual Node | endForStmt (Node forNode, NodeVector &bodyNodes)=0 |
Discrete Subtype Definition Callbacks. | |
virtual Node | acceptDSTDefinition (Node name, Node lower, Node upper)=0 |
virtual Node | acceptDSTDefinition (Node nameOrAttribute, bool isUnconstrained)=0 |
virtual Node | acceptDSTDefinition (Node lower, Node upper)=0 |
Block Callbacks. | |
Blocks are introduced with a call to beginBlockStmt and terminated with a call to endBlockStmt. Each item in the blocks declarative region is processed via one of the declaration callbacks. Each statement associated with the block is registerd via a call to acceptStmt with the context being the node returned by the initial call to beginBlockStmt. | |
virtual Node | beginBlockStmt (Location loc, IdentifierInfo *label=0)=0 |
Called when a block statement is about to be parsed. | |
virtual void | endBlockStmt (Node block)=0 |
Exception Handler Callbacks. | |
virtual Node | beginHandlerStmt (Location loc, NodeVector &choices)=0 |
virtual void | endHandlerStmt (Node context, Node handler)=0 |
Enumeration Callbacks. | |
virtual void | beginEnumeration (IdentifierInfo *name, Location loc)=0 |
virtual void | acceptEnumerationIdentifier (IdentifierInfo *name, Location loc)=0 |
virtual void | acceptEnumerationCharacter (IdentifierInfo *name, Location loc)=0 |
virtual void | endEnumeration ()=0 |
Record Type Declaration Callbacks. | |
virtual void | beginRecord (IdentifierInfo *name, Location loc)=0 |
virtual void | acceptRecordComponent (IdentifierInfo *name, Location loc, Node type)=0 |
virtual void | endRecord ()=0 |
Completes the definition of a record type. | |
Protected Member Functions | |
Node | getNode (void *ptr) |
Allow sub-classes to construct arbitrary nodes. | |
Node | getReleasedNode (void *ptr) |
Definition at line 172 of file ParseClient.h.
virtual void comma::ParseClient::acceptAccessTypeDecl | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | subtype | |||
) | [pure virtual] |
Called to notify the client of an access type declaration.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptAggregateKey | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Called to indicate an aggregate key consisting of a single identifier.
This callback is provided to support selectors of a record aggregate. Since Comma aggregates cannot be resolved without a type context it is not reasonable to expect a ParseClient implementation to divine the meaning of aggregate keys. This callback allows a client to defer the processing of aggregate keys which may resolve to a record selector or to a direct name until enough context is established.
Implemented in comma::TypeCheck.
Called to indicate an aggregate key consisting of an expression or subtype indication.
Implemented in comma::TypeCheck.
Called to indicate an aggregate key in the form of a range.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptAggregateOthers | ( | Location | loc, | |
Node | component | |||
) | [pure virtual] |
Indicates an "others" component. If this callback is invoked, it is always the last component processed by the parser.
loc | Location of the "others" reserved word. | |
component | An expression denoting the default value for this aggregate, or a null node if others => <> was parsed. |
Implemented in comma::TypeCheck.
Incoked whten the parser encounters an allocator expression.
operand | The argument to the allocator. This is either a name or result of acceptQualifiedExpr. | |
loc | Location of the "new" reserved word. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptApplication | ( | Node | prefix, | |
NodeVector & | argumentNodes | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptArrayDecl | ( | IdentifierInfo * | name, | |
Location | loc, | |||
NodeVector | indices, | |||
Node | component | |||
) | [pure virtual] |
Communicates an array type declaration.
name | The name of this array type declaration. | |
loc | the location of name . | |
indices | A set of nodes defining the index specification for this array, each being the result of a call to acceptDSTDefinition. | |
component | The component type of the array declaration. |
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptAttribute | ( | Node | prefix, | |
IdentifierInfo * | name, | |||
Location | loc | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptCarrier | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | typeNode | |||
) | [pure virtual] |
Invoked when the parser consumes a carrier declaration.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptCharacterLiteral | ( | IdentifierInfo * | lit, | |
Location | loc | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Notifies the client of an explicit dereference expression.
prefix | The name to be dereferenced. | |
loc | Location of the reserved word all . |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptDirectName | ( | IdentifierInfo * | name, | |
Location | loc, | |||
bool | forStatement | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Indicates a discrete subtype definition that was sepcified using only a range.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptDSTDefinition | ( | Node | nameOrAttribute, | |
bool | isUnconstrained | |||
) | [pure virtual] |
Indicates a discrete subtype definition which was specified using a name which may include a range attribute. If isUnconstrained
is true, then the given node was followed by the "range <>" syntax, and the parser is in the midst of processing an array type definition.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptDSTDefinition | ( | Node | name, | |
Node | lower, | |||
Node | upper | |||
) | [pure virtual] |
Indicates a discrete subtype definition which was accompanied by a range constraint.
name | The subtype mark of this definition. | |
lower | The lower bound of the range constraint. | |
upper | The upper bound of the range constraint. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptElseStmt | ( | Location | loc, | |
Node | ifNode, | |||
NodeVector & | alternates | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptElsifStmt | ( | Location | loc, | |
Node | ifNode, | |||
Node | condition, | |||
NodeVector & | consequents | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptEnumerationCharacter | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Called to introduce an enumeration component which was defined using character syntax.
name | The name of the character literal defining this component. This is always the full name of the literal. For example, the character literal for X is named using the string "'X'" (note that the quotes are included). | |
loc | The location of the defining character literal. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptEnumerationIdentifier | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Called to introduce an enumeration component which was defined using identifier syntax.
name | The defining identifier for this component. | |
loc | The location of the defining identifier. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptFormalDomain | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | sig | |||
) | [pure virtual] |
Called to notify the client of a generic formal domain parameter.
name | The defining identifier of the domain. | |
loc | Location of the defining identifier. | |
sig | If the formal domain was specified as satisfying a particular signature, sig is a valid node as returned by a call to parseName(). Otherwise sig is a null node. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptFunctionReturnType | ( | Node | typeNode | ) | [pure virtual] |
When parsing a function declaration, this callback is invoked to notify the client of the declarations return type.
If the function declaration was missing a return type, or the node returned by the client representing the type is invalid, this callback is passed a null node as argument. Note that the parser posts a diagnostic for the case of a missing return.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptIfStmt | ( | Location | loc, | |
Node | condition, | |||
NodeVector & | consequents | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual bool comma::ParseClient::acceptImportDeclaration | ( | Node | importedType | ) | [pure virtual] |
Submits an import from the given type node.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptIncompleteTypeDecl | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Called to notify the client of an incomplete type declaration.
This callback is invoked when processing type declarations of the form type Foo;<>.
Implemented in comma::TypeCheck.
Called for "inj" expressions. loc is the location of the inj token and expr is its argument.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptIntegerLiteral | ( | llvm::APInt & | value, | |
Location | loc | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptIntegerTypeDecl | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | low, | |||
Node | high | |||
) | [pure virtual] |
Called to process integer type declarations.
For example, given a definition of the form type T is range X..Y;
, this callback is invoked with name
set to the identifier T
, loc
set to the location of name
, low
set to the expression X
, and high
set to the expression Y
.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptKeyedAggregateComponent | ( | NodeVector & | keys, | |
Node | expr, | |||
Location | loc | |||
) | [pure virtual] |
Provides a vector of keys and associated expression for a keyed aggregate component.
keys | A vector of valid nodes as returned by acceptAggregateKey. | |
expr | Expression denoting the value associated with the given keys, or a null node if a diamond was parsed. | |
loc | Location of the given expression (for use when expr is null). |
keys
may be empty if none of the keys parsed correctly or the client returned an invalid node for them all. Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptLoopStmt | ( | Location | loc, | |
NodeVector & | stmtNodes | |||
) | [pure virtual] |
Called to inform the client of a loop statement.
Implemented in comma::TypeCheck.
Invoked when the parser encounters the "null" reserved word in an expression context.
Implemented in comma::TypeCheck.
Called to notify the client of a null statement at the given position.
Implemented in comma::TypeCheck.
virtual bool comma::ParseClient::acceptObjectDeclaration | ( | Location | loc, | |
IdentifierInfo * | name, | |||
Node | type, | |||
Node | initializer | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptParameterAssociation | ( | IdentifierInfo * | key, | |
Location | loc, | |||
Node | rhs | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptPositionalAggregateComponent | ( | Node | component | ) | [pure virtual] |
Provides a Node describing a positional component of the aggregate.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptPragmaImport | ( | Location | pragmaLoc, | |
IdentifierInfo * | convention, | |||
Location | conventionLoc, | |||
IdentifierInfo * | enity, | |||
Location | entityLoc, | |||
Node | externalNameNode | |||
) | [pure virtual] |
Called when a pragma Import is encountered. These pragmas can occur when processing a list of declarative items.
pragmaLoc | The location of the Import identifier. | |
convention | An identifier naming the convention to be used. Note that the parser does not know what identifiers name valid conventions. | |
conventionLoc | The location of the convention identifier. | |
entity | The identifier naming the entity to import. | |
entityLoc | The location of the entity identifier. | |
externalNameNode | An arbitrary expression node. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptPragmaStmt | ( | IdentifierInfo * | name, | |
Location | loc, | |||
NodeVector & | pragmaArgs | |||
) | [pure virtual] |
Called when a pragma is encountered within a sequence of statements.
Implemented in comma::TypeCheck.
Called for "prj" expressions. loc is the location of the prj token and expr is its argument.
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptQualifiedExpr | ( | Node | qualifier, | |
Node | operand | |||
) | [pure virtual] |
Invoked when the parser encounters a qualified expression.
qualifier | A node corresponding to the qualified name. | |
operand | The expression to qualify. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptRaiseStmt | ( | Location | loc, | |
Node | exception, | |||
Node | message | |||
) | [pure virtual] |
Called to inform the client of a raise statement.
loc | Location of the `raise' reserved word. | |
exception | Node representing the exception to be thrown (as obtained thru the name callbacks). | |
message | Contains the expression node to be associated with the `raise', or a null-node if there was no expression. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptRangedSubtypeDecl | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | subtype, | |||
Node | low, | |||
Node | high | |||
) | [pure virtual] |
Called to process a range constrained discrete subtype declaration.
For example, given a declaration of the form subtype S is T range X..Y;
, this callback is invoked with name
set to the identifier S
, loc
set to the location of name
, and subtype
set to the subtype indication T
, and the last two arguments (low
and high
) represent the lower and upper bounds of the range constraint.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptRecordComponent | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | type | |||
) | [pure virtual] |
Called to notify the client of a record component.
name | The defining identifier for this record component. | |
loc | The location of the components defining identifier. | |
type | A node representing the type of this identifier. |
Implemented in comma::TypeCheck.
virtual bool comma::ParseClient::acceptRenamedObjectDeclaration | ( | Location | loc, | |
IdentifierInfo * | name, | |||
Node | type, | |||
Node | target | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptSelectedComponent | ( | Node | prefix, | |
IdentifierInfo * | name, | |||
Location | loc, | |||
bool | forStatement | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
Called to notify the client that a statement has been completely parsed.
context | The result of a call to beginBlockStmt or beginSubroutineDefinition, indicating in which context stmt appeared in. | |
stmt | The actual Node representing the statement (as returned from accpetIfStmt, acceptAssignmentStmt, etc). |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptStringLiteral | ( | const char * | string, | |
unsigned | len, | |||
Location | loc | |||
) | [pure virtual] |
Invoked when the parser encounters a string literal.
string | A pointer to the first quotation character of the string literal. The string is not necessarily null terminated, and is owned by the parser. Clients should copy the contents of the string if needed. | |
len | The number of characters in the string. | |
loc | The location of the first quotation character. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptSubroutineParameter | ( | IdentifierInfo * | formal, | |
Location | loc, | |||
Node | typeNode, | |||
PM::ParameterMode | mode | |||
) | [pure virtual] |
For each subroutine parameter, acceptSubroutineParameter is called providing:
formal | The name of the formal parameter. | |
loc | The location of the formal parameter name. | |
typeNode | A node describing the type of the parameter (the result of a call to acceptTypeName or acceptTypeApplication, for example). | |
mode | The parameter mode, wher PM::MODE_DEFAULT is supplied if an explicit mode was not parsed. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptSubtypeDecl | ( | IdentifierInfo * | name, | |
Location | loc, | |||
Node | subtype | |||
) | [pure virtual] |
Called to process an unconstrained subtype declaration.
For example, given a declaration of the form subtype S is T;
, this callback is invoked with name
set to the identifier S
, loc
set to the location of name
, and subtype
set to the subtype indication T
.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::acceptSupersignature | ( | Node | typeNode | ) | [pure virtual] |
Called for each super signature defined in a signature profile.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::acceptWhileStmt | ( | Location | loc, | |
Node | condition, | |||
NodeVector & | stmtNodes | |||
) | [pure virtual] |
Called to inform the client of a while statement.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginAddExpression | ( | ) | [pure virtual] |
Called at the begining of an add expression. The client accepts components of an add expression after this call until endAddExpression is called.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginAggregate | ( | Location | loc | ) | [pure virtual] |
The start of an aggregate expression is communicated to the client with a call to beginAggregate(). For each component of the aggregate acceptAggregateComponent() is called. The end of the aggregate expression is voiced with a call to endAggregate(). Signals that an aggregate expression is about to be processed.
loc | Location of opening paren starting the aggregate. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::beginBlockStmt | ( | Location | loc, | |
IdentifierInfo * | label = 0 | |||
) | [pure virtual] |
Called when a block statement is about to be parsed.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginCapsule | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginDomainDecl | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginEnumeration | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Establishes a context beginning an enumeration type declaration.
name | The name of this enumeration type declaration. | |
loc | The location of the enumerations name. |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::beginForStmt | ( | Location | loc, | |
IdentifierInfo * | iterName, | |||
Location | iterLoc, | |||
Node | control, | |||
bool | isReversed | |||
) | [pure virtual] |
Begins a for
statement.
loc | Location of the for reserved word. | |
iterName | Defining identifier for the loop parameter. | |
iterLoc | Location of iterName . | |
control | A node representing the subtype definition, range, or range attribute controlling this loop. This node is obtained by a call to acceptDSTDefinition. | |
isReversed | Set to true when the reverse reserved word was present in the loop specification. |
for
loop being processed. The returned value is supplied to the corresponding endForStmt() call. Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginFunctionDeclaration | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
When parsing a function declaration, this callback is invoked to notify the client of the declarations return type.
If the function declaration was missing a return type, or the node returned by the client representing the type is invalid, this callback is passed a null node as argument. Note that the parser posts a diagnostic for the case of a missing return.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginGenericFormals | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::beginHandlerStmt | ( | Location | loc, | |
NodeVector & | choices | |||
) | [pure virtual] |
Begins an exception handler.
loc | Location of the when reserved word. | |
choices | Set of valid nodes as procudueced by the name callbacks representing the set of exceptions this handler covers. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginProcedureDeclaration | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
When parsing a function declaration, this callback is invoked to notify the client of the declarations return type.
If the function declaration was missing a return type, or the node returned by the client representing the type is invalid, this callback is passed a null node as argument. Note that the parser posts a diagnostic for the case of a missing return.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginRecord | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Begins the definition of a record type.
name | The defining identifier for this record. | |
loc | The location of the defining identifier. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginSignatureDecl | ( | IdentifierInfo * | name, | |
Location | loc | |||
) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::beginSignatureProfile | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
Once a declaration has been parsed, a context for a definition is introduced with a call to beginSubroutineDefinition (assuming the declaration has a definition), passing in the node returned from endSubroutineDeclaration. The returned Node will be used as the first parameter to acceptStmt and endHandlerStmt for each statement and exception handler constituting the definition.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::deleteNode | ( | Node & | node | ) | [pure virtual] |
Nodes do not know the representation of the data they carry. This method is called by Nodes once their reference counts drop to zero. The implementation need not delete the node as a result of this call -- it might choose to cache it, for instance.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endAddExpression | ( | ) | [pure virtual] |
Completes an add expression.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::endAggregate | ( | ) | [pure virtual] |
Signals that an aggregate expression has completed.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endBlockStmt | ( | Node | block | ) | [pure virtual] |
Once the last statement of a block has been parsed, this method is called to inform the client that we are leaving the block context established by the last call to beginBlockStmt.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endCapsule | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endEnumeration | ( | ) | [pure virtual] |
Called when all of the enumeration literals have been processed, thus completing the definition of the enumeration.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::endForStmt | ( | Node | forNode, | |
NodeVector & | bodyNodes | |||
) | [pure virtual] |
Terminates a for
statement.
forNode | The Node returned by the previous call to beginForStmt(). | |
bodyNodes | A vector of nodes corresponding to each statement in the loop body. |
for
stmt. Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endGenericFormals | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
Completes an exception handler.
context | A Node which this handler should be associated with. This is the result of a call to beginSubroutineDefinition or beginBlockStmt. | |
handler | The Node returned by a call to beginHandlerStmt. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endRecord | ( | ) | [pure virtual] |
Completes the definition of a record type.
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endSignatureProfile | ( | ) | [pure virtual] |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endSubroutineBody | ( | Node | context | ) | [pure virtual] |
Once the sequence of statements constituting the body of the subroutine has been parsed (not counting any exception handlers), this method is invoked to inform the client of the completion of the body.
Implemented in comma::TypeCheck.
virtual Node comma::ParseClient::endSubroutineDeclaration | ( | bool | definitionFollows | ) | [pure virtual] |
Called to terminate the context of a subroutine declaration.
definitionFollows | Set to true if the parser sees a is token following the declaration and thus expects a definition to follow. |
Implemented in comma::TypeCheck.
virtual void comma::ParseClient::endSubroutineDefinition | ( | ) | [pure virtual] |
Once endSubroutineBody has been called and any exception handlers have been processed this callback is invoked to signal the completion of the definition.
Implemented in comma::TypeCheck.
Implemented in comma::TypeCheck.
Node comma::ParseClient::getInvalidNode | ( | ) | [inline] |
Nodes cannot be constructed from outside a parse client. However, the parser needs to be able to create invalid nodes to communicate failures during parsing (just as the ParseClient returns invalid nodes to indicate a semantic failure).
Definition at line 185 of file ParseClient.h.
Node comma::ParseClient::getNode | ( | void * | ptr | ) | [inline, protected] |
Allow sub-classes to construct arbitrary nodes.
Definition at line 834 of file ParseClient.h.
Node comma::ParseClient::getNullNode | ( | ) | [inline] |
Nodes cannot be constructed from outside a parse client, yet many of the callbacks take null nodes indicateing a non-existant argument. This method is made available to the parser so that it has a means of producing such null nodes.
Definition at line 179 of file ParseClient.h.
Node comma::ParseClient::getReleasedNode | ( | void * | ptr | ) | [inline, protected] |
Construct a node which has released its ownership to the associated data.
Definition at line 838 of file ParseClient.h.