The static information associated with a local variable binding.
EARLY_INIT
public static final int EARLY_INIT
Initialize in <init>
/<clinit>
rather than in run
/$run$
.
EXPORT_SPECIFIED
public static final int EXPORT_SPECIFIED
EXTERNAL_ACCESS
public static final int EXTERNAL_ACCESS
This flag bit is set if this can be be acceessed from other modules.
Ignored unless PRIVATE.
Used when an exported macro references a non-exported name.
FIELD_OR_METHOD
public static final int FIELD_OR_METHOD
True if this is a field or method in a class definition.
IS_ALIAS
public static final int IS_ALIAS
IS_CONSTANT
public static final int IS_CONSTANT
IS_DYNAMIC
public static final int IS_DYNAMIC
IS_IMPORTED
public static final int IS_IMPORTED
IS_NAMESPACE_PREFIX
public static final int IS_NAMESPACE_PREFIX
Set if this declares a namespace prefix (as in XML namespaces).
IS_SINGLE_VALUE
public static final int IS_SINGLE_VALUE
IS_SYNTAX
public static final int IS_SYNTAX
IS_UNKNOWN
public static final int IS_UNKNOWN
MODULE_REFERENCE
public static final int MODULE_REFERENCE
A reference to a module instance.
NONSTATIC_SPECIFIED
public static final int NONSTATIC_SPECIFIED
NOT_DEFINING
public static final int NOT_DEFINING
Set if this is just a declaration, not a definition.
PACKAGE_ACCESS
public static final int PACKAGE_ACCESS
PRIVATE_ACCESS
public static final int PRIVATE_ACCESS
PRIVATE_PREFIX
public static final String PRIVATE_PREFIX
This prefix is used in field names for a declaration that has
both EXTERNAL_ACCESS and IS_PRIVATE set.
PRIVATE_SPECIFIED
public static final int PRIVATE_SPECIFIED
PROTECTED_ACCESS
public static final int PROTECTED_ACCESS
PUBLIC_ACCESS
public static final int PUBLIC_ACCESS
STATIC_SPECIFIED
public static final int STATIC_SPECIFIED
TYPE_SPECIFIED
public static final int TYPE_SPECIFIED
base
public Declaration base
If non-null, field is relative to base.
If IS_FLUID, base points to IS_UNKNOWN Symbol.
firstCall
public ApplyExp firstCall
List of ApplyExp where this declaration is the function called.
The applications are chained using their nextcall fields.
id
protected int id
Unique id number, to ease print-outs and debugging.
If negative, a code to specify a builtin function.
value
protected Expression value
If non-null, the single expression used to set this variable.
If the variable can be set more than once, then value is null.
getAccessFlags
public short getAccessFlags(short defaultFlags)
getCanCall
public final boolean getCanCall()
getCanRead
public final boolean getCanRead()
getCanWrite
public final boolean getCanWrite()
getCode
public int getCode()
getColumn
public final int getColumn()
getConstantValue
public final Object getConstantValue()
If getValue() is a constant, return the constant value, otherwise null.
getContext
public final ScopeExp getContext()
Return the ScopeExp that contains (declares) this Declaration.
getDeclaration
public static Declaration getDeclaration(Object proc,
String name)
getDeclarationFromStatic
public static Declaration getDeclarationFromStatic(String cname,
String fname)
Create a declaration corresponding to a static field.
cname
- name of class containing fieldfname
- name of static field
getFile
public final String getFile()
getFlag
public final boolean getFlag(int flag)
getLine
public final int getLine()
Get the line number of (the start of) this Expression.
The "first" line is line 1.
getName
public final String getName()
getSymbol
public final Object getSymbol()
getType
public final Type getType()
getValue
public final Expression getValue()
The value of this Declaration
, if known.
Usually the expression used to initialize the Declaration
,
or null if the Declaration
can be assigned a different
value after initialization. Note that this is the semantic value: If the
INDIRECT_LOCATION
is set, then getValue
is the
value after de-referencing the resulting Location
.
An exception is if isAlias()
; in that case
getValue()
is an expression yielding a Location
which needs to be de-referenced to get this Declaration
's
actual value.
getVariable
public Variable getVariable()
ignorable
public boolean ignorable()
True if we never need to access this declaration.
isAlias
public final boolean isAlias()
isFluid
public final boolean isFluid()
True if this is a fluid binding (in a FluidLetExp).
isIndirectBinding
public final boolean isIndirectBinding()
True if the value of the variable is the contents of a Location.
isLexical
public final boolean isLexical()
isNamespaceDecl
public final boolean isNamespaceDecl()
isPrivate
public final boolean isPrivate()
isProcedureDecl
public final boolean isProcedureDecl()
isPublic
public final boolean isPublic()
isSimple
public final boolean isSimple()
isStatic
public boolean isStatic()
isThisParameter
public final boolean isThisParameter()
Is this an implicit 'this' parameter?
needsContext
public final boolean needsContext()
If we need a 'context' supplied from a ReferenceExp or 'this.
needsExternalAccess
public final boolean needsExternalAccess()
needsInit
public boolean needsInit()
Does this variable need to be initialized or is default ok
printInfo
public void printInfo(StringBuffer sbuf)
printInfo
public void printInfo(OutPort out)
pushIndirectBinding
public void pushIndirectBinding(Compilation comp)
Create a Location object, given that isIndirectBinding().
Assume the initial value is already pushed on the stack;
leaves initialized Location object on stack.
setAlias
public final void setAlias(boolean flag)
setCanCall
public final void setCanCall()
setCanCall
public final void setCanCall(boolean called)
setCanRead
public final void setCanRead()
setCanRead
public final void setCanRead(boolean read)
setCanWrite
public final void setCanWrite()
setCanWrite
public final void setCanWrite(boolean written)
setCode
public void setCode(int code)
setFile
public final void setFile(String filename)
setFlag
public final void setFlag(boolean setting,
int flag)
setFlag
public final void setFlag(int flag)
setFluid
public final void setFluid(boolean fluid)
setIndirectBinding
public final void setIndirectBinding(boolean indirectBinding)
Note that the value of the variable is the contents of a Location.
setLine
public final void setLine(int lineno)
setLine
public final void setLine(int lineno,
int colno)
setName
public final void setName(Object symbol)
setPrivate
public final void setPrivate(boolean isPrivate)
setProcedureDecl
public final void setProcedureDecl(boolean val)
setSimple
public final void setSimple(boolean b)
setSymbol
public final void setSymbol(Object symbol)
setSyntax
public final void setSyntax()
setType
public final void setType(Type type)
setValue
public final void setValue(Expression value)
Set the value assoociated with this Declaration.
Most code should use noteValue instead.
toString
public String toString()