public interface CAstEntity
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.
| Modifier and Type | Field and Description |
|---|---|
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 |
GLOBAL_ENTITY
This entity represents a global varible
|
static int |
MACRO_ENTITY
This entity is a macro.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<CAstNode,java.util.Collection<CAstEntity>> |
getAllScopedEntities()
Some programming language constructs have a lexical structure.
|
java.util.Collection<CAstAnnotation> |
getAnnotations()
Returns the set of any annotations this entity may have
|
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.
|
CAstSourcePositionMap.Position |
getNamePosition()
The source position of the token denoting this entity's name.
|
CAstNodeTypeMap |
getNodeTypeMap()
The map from CAstNodes to types.
|
default CAstEntity |
getOriginal()
Allow finding original entity after rewrites
|
CAstSourcePositionMap.Position |
getPosition()
The source position of this entity.
|
CAstSourcePositionMap.Position |
getPosition(int arg)
The source position of argument 'arg' this entity, if any;
|
java.util.Collection<CAstQualifier> |
getQualifiers()
Returns an Iterator over the qualifiers of the given entity, if it has any, e.g., "final",
"private".
|
java.util.Iterator<CAstEntity> |
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.
|
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 MACRO_ENTITY
static final int GLOBAL_ENTITY
static final int SUB_LANGUAGE_BASE
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<CAstEntity> getScopedEntities(CAstNode construct)
Enclosed entities not induced by a specific AST node are mapped by the construct 'null'.
CAstNode getAST()
CAstControlFlowMap getControlFlow()
CAstSourcePositionMap getSourceMap()
CAstSourcePositionMap.Position getPosition()
CAstSourcePositionMap.Position getNamePosition()
CAstSourcePositionMap.Position getPosition(int arg)
CAstNodeTypeMap getNodeTypeMap()
java.util.Collection<CAstQualifier> getQualifiers()
CAstType getType()
java.util.Collection<CAstAnnotation> getAnnotations()
default CAstEntity getOriginal()