|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CAstEntity
The assumption is that abstract syntax trees pertain to particular programming language constructs, such as classes, methods, programs and the like. Thus, the expectation is that users of CAPA AST will typically be communicating such entities, and this interface is meant to give them a mechanism to do this. The set of kinds that are currently in this file is not meant to be exhaustive, and should be extended as needed for any new languages that come along.
| Field Summary | |
|---|---|
static int |
FIELD_ENTITY
This entity is a field in an object-oriented language. |
static int |
FILE_ENTITY
This entity is a source file (i.e. |
static int |
FUNCTION_ENTITY
This entity is a function. |
static int |
RULE_ENTITY
This entity represents a rule in a logic language. |
static int |
SCRIPT_ENTITY
This entity is a program script for a scripting language. |
static int |
SUB_LANGUAGE_BASE
Languages that introduce new kinds of CAstEntity should use this number as the base of integers chosen to denote the new entity types. |
static int |
TYPE_ENTITY
This entity is a type in an object-oriented language. |
| Method Summary | |
|---|---|
java.util.Map<CAstNode,java.util.Collection<CAstEntity>> |
getAllScopedEntities()
Some programming language constructs have a lexical structure. |
int |
getArgumentCount()
Some programming language constructs have a specific number of arguments. |
CAstNode[] |
getArgumentDefaults()
Some programming language constructs allow arguments to have default values. |
java.lang.String[] |
getArgumentNames()
Some programming language constructs have named arguments. |
CAstNode |
getAST()
The CAPA AST of this entity. |
CAstControlFlowMap |
getControlFlow()
The control flow map for the CAPA AST of this entity. |
int |
getKind()
What kind of entity is this? The answer should be one of the constants in this file. |
java.lang.String |
getName()
Some programming language constructs have names. |
CAstNodeTypeMap |
getNodeTypeMap()
The map from CAstNodes to types. |
CAstSourcePositionMap.Position |
getPosition()
The source position of this entity. |
java.util.Collection |
getQualifiers()
Returns an Iterator over the qualifiers of the given entity, if it has any, e.g., "final", "private". |
java.util.Iterator |
getScopedEntities(CAstNode construct)
Some programming language constructs have a lexical structure. |
java.lang.String |
getSignature()
Some programming language constructs have signatures, which are like names but usually have some detail to distinguish the construct from others with the same name. |
CAstSourcePositionMap |
getSourceMap()
The map of CAstNodes to source positions for the CAPA AST of this entity. |
CAstType |
getType()
The CAst type of this entity. |
| Field Detail |
|---|
static final int FUNCTION_ENTITY
static final int SCRIPT_ENTITY
static final int TYPE_ENTITY
static final int FIELD_ENTITY
static final int FILE_ENTITY
static final int RULE_ENTITY
static final int SUB_LANGUAGE_BASE
| Method Detail |
|---|
int getKind()
java.lang.String getName()
java.lang.String getSignature()
java.lang.String[] getArgumentNames()
CAstNode[] getArgumentDefaults()
int getArgumentCount()
java.util.Map<CAstNode,java.util.Collection<CAstEntity>> getAllScopedEntities()
java.util.Iterator getScopedEntities(CAstNode construct)
CAstNode getAST()
CAstControlFlowMap getControlFlow()
CAstSourcePositionMap getSourceMap()
CAstSourcePositionMap.Position getPosition()
CAstNodeTypeMap getNodeTypeMap()
java.util.Collection getQualifiers()
CAstType getType()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||