public class BuiltinReference extends Object implements IReference
IReference
representing one of the builtin types,
such as Object
, String
or Array
.
This reference will always resolve to the builtins for a particular project.
It is used for things like the type of a FunctionDefinition
,
which should be the global Function
type, and not some
Function
type defined in some other random namespace.
Constructor and Description |
---|
BuiltinReference(IASLanguageConstants.BuiltinType type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getDisplayString()
Gets a string representation of this reference suitable for display
in the description of a compiler problem.
|
Name |
getMName(ICompilerProject project,
ASScope scope)
Gets the AET {link Name} that this reference represents in the given
project and scope.
|
String |
getName()
Gets the base name for this reference.
|
IDefinition |
resolve(ICompilerProject project,
ASScope scope,
DependencyType dependencyType,
boolean canEscapeWith)
Resolves the reference to its
IDefinition in the given project
and scope. |
public BuiltinReference(IASLanguageConstants.BuiltinType type)
public String getName()
IReference
getName
in interface IReference
String.
-
resolve
public IDefinition resolve(ICompilerProject project,
ASScope scope,
DependencyType dependencyType,
boolean canEscapeWith)
Description copied from interface: IReference
Resolves the reference to its IDefinition
in the given project
and scope.
- Specified by:
resolve
in interface IReference
- Parameters:
project
- The project in which to resolve the reference.scope
- The scope where the resolution is occurring.dependencyType
- The type of dependency to introduce if the reference
resolves outside of the compilation unit.canEscapeWith
- Whether the resolution should look past a
with
scope.
- Returns:
- The
IDefinition
the reference resolves to.
-
getDisplayString
public String getDisplayString()
Description copied from interface: IReference
Gets a string representation of this reference suitable for display
in the description of a compiler problem.
- Specified by:
getDisplayString
in interface IReference
-
getMName
public Name getMName(ICompilerProject project,
ASScope scope)
Description copied from interface: IReference
Gets the AET {link Name} that this reference represents in the given
project and scope.
- Specified by:
getMName
in interface IReference
- Parameters:
project
- The project where the reference is used.scope
- The scope where the reference is used from.
- Returns:
- An AET
Name
representing this reference
Copyright © 2016 The Apache Software Foundation. All rights reserved.