|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.expr.Declaration
public class Declaration
The static information associated with a local variable binding.
Field Summary | |
---|---|
Declaration |
base
If non-null, field is relative to base. |
ScopeExp |
context
|
static int |
EARLY_INIT
Initialize in <init> /<clinit>
rather than in run /$run$ . |
static int |
EXPORT_SPECIFIED
|
static int |
EXTERNAL_ACCESS
This flag bit is set if this can be be acceessed from other modules. |
Field |
field
|
static int |
FIELD_OR_METHOD
True if this is a field or method in a class definition. |
ApplyExp |
firstCall
List of ApplyExp where this declaration is the function called. |
protected int |
flags
|
protected int |
id
Unique id number, to ease print-outs and debugging. |
static int |
IS_ALIAS
|
static int |
IS_CONSTANT
|
static int |
IS_DYNAMIC
|
static int |
IS_IMPORTED
|
static int |
IS_NAMESPACE_PREFIX
Set if this declares a namespace prefix (as in XML namespaces). |
static int |
IS_SINGLE_VALUE
|
static int |
IS_SYNTAX
|
static int |
IS_UNKNOWN
|
static int |
MODULE_REFERENCE
A reference to a module instance. |
static int |
NONSTATIC_SPECIFIED
|
static int |
NOT_DEFINING
Set if this is just a declaration, not a definition. |
static int |
PACKAGE_ACCESS
|
static int |
PRIVATE_ACCESS
|
static java.lang.String |
PRIVATE_PREFIX
This prefix is used in field names for a declaration that has both EXTERNAL_ACCESS and IS_PRIVATE set. |
static int |
PRIVATE_SPECIFIED
|
static int |
PROTECTED_ACCESS
|
static int |
PUBLIC_ACCESS
|
static int |
STATIC_SPECIFIED
|
protected Type |
type
|
static int |
TYPE_SPECIFIED
|
protected Expression |
value
If non-null, the single expression used to set this variable. |
Constructor Summary | |
---|---|
protected |
Declaration()
|
|
Declaration(java.lang.Object name)
|
|
Declaration(java.lang.Object name,
Field field)
|
|
Declaration(java.lang.Object s,
Type type)
|
|
Declaration(Variable var)
|
Method Summary | |
---|---|
Variable |
allocateVariable(CodeAttr code)
|
void |
compileStore(Compilation comp)
|
static Declaration |
followAliases(Declaration decl)
|
short |
getAccessFlags(short defaultFlags)
|
boolean |
getCanCall()
|
boolean |
getCanRead()
|
boolean |
getCanWrite()
|
int |
getCode()
|
int |
getColumn()
|
java.lang.Object |
getConstantValue()
If getValue() is a constant, return the constant value, otherwise null. |
ScopeExp |
getContext()
Return the ScopeExp that contains (declares) this Declaration. |
static Declaration |
getDeclaration(Named proc)
|
static Declaration |
getDeclaration(java.lang.Object proc,
java.lang.String name)
|
static Declaration |
getDeclarationFromStatic(java.lang.String cname,
java.lang.String fname)
Create a declaration corresponding to a static field. |
java.lang.String |
getFile()
|
boolean |
getFlag(int flag)
|
int |
getLine()
Get the line number of (the start of) this Expression. |
java.lang.String |
getName()
|
java.lang.Object |
getSymbol()
|
Type |
getType()
|
Expression |
getValue()
The value of this Declaration , if known. |
Variable |
getVariable()
|
boolean |
ignorable()
True if we never need to access this declaration. |
boolean |
isAlias()
|
boolean |
isFluid()
True if this is a fluid binding (in a FluidLetExp). |
boolean |
isIndirectBinding()
True if the value of the variable is the contents of a Location. |
boolean |
isLexical()
|
boolean |
isNamespaceDecl()
|
boolean |
isPrivate()
|
boolean |
isProcedureDecl()
|
boolean |
isPublic()
|
boolean |
isSimple()
|
boolean |
isStatic()
|
boolean |
isThisParameter()
Is this an implicit 'this' parameter? |
void |
load(Declaration owner,
int flags,
Compilation comp,
Target target)
|
void |
makeField(ClassType frameType,
Compilation comp,
Expression value)
|
void |
makeField(Compilation comp,
Expression value)
|
boolean |
needsContext()
If we need a 'context' supplied from a ReferenceExp or 'this. |
boolean |
needsExternalAccess()
|
boolean |
needsInit()
Does this variable need to be initialized or is default ok |
Declaration |
nextDecl()
|
void |
noteValue(Expression value)
|
void |
printInfo(OutPort out)
|
void |
printInfo(java.lang.StringBuffer sbuf)
|
void |
pushIndirectBinding(Compilation comp)
Create a Location object, given that isIndirectBinding(). |
void |
setAlias(boolean flag)
|
void |
setCanCall()
|
void |
setCanCall(boolean called)
|
void |
setCanRead()
|
void |
setCanRead(boolean read)
|
void |
setCanWrite()
|
void |
setCanWrite(boolean written)
|
void |
setCode(int code)
|
void |
setFile(java.lang.String filename)
|
void |
setFlag(boolean setting,
int flag)
|
void |
setFlag(int flag)
|
void |
setFluid(boolean fluid)
|
void |
setIndirectBinding(boolean indirectBinding)
Note that the value of the variable is the contents of a Location. |
void |
setLine(int lineno)
|
void |
setLine(int lineno,
int colno)
|
void |
setName(java.lang.Object symbol)
|
void |
setNext(Declaration next)
|
void |
setPrivate(boolean isPrivate)
|
void |
setProcedureDecl(boolean val)
|
void |
setSimple(boolean b)
|
void |
setSymbol(java.lang.Object symbol)
|
void |
setSyntax()
|
void |
setType(Type type)
|
void |
setValue(Expression value)
Set the value assoociated with this Declaration. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int id
public ScopeExp context
protected Type type
public Declaration base
public Field field
protected Expression value
public static final java.lang.String PRIVATE_PREFIX
public static final int IS_ALIAS
public static final int NOT_DEFINING
public static final int EXPORT_SPECIFIED
public static final int STATIC_SPECIFIED
public static final int NONSTATIC_SPECIFIED
public static final int TYPE_SPECIFIED
public static final int IS_CONSTANT
public static final int IS_SYNTAX
public static final int IS_UNKNOWN
public static final int IS_IMPORTED
public static final int IS_SINGLE_VALUE
public static final int EXTERNAL_ACCESS
public static final int FIELD_OR_METHOD
public static final int IS_NAMESPACE_PREFIX
public static final int PRIVATE_ACCESS
public static final int PRIVATE_SPECIFIED
public static final int PROTECTED_ACCESS
public static final int PUBLIC_ACCESS
public static final int PACKAGE_ACCESS
public static final int IS_DYNAMIC
public static final int EARLY_INIT
<init>
/<clinit>
rather than in run
/$run$
.
public static final int MODULE_REFERENCE
protected int flags
public ApplyExp firstCall
Constructor Detail |
---|
protected Declaration()
public Declaration(Variable var)
public Declaration(java.lang.Object name)
public Declaration(java.lang.Object s, Type type)
public Declaration(java.lang.Object name, Field field)
Method Detail |
---|
public void setCode(int code)
public int getCode()
public final Type getType()
public final void setType(Type type)
public final java.lang.String getName()
public final void setName(java.lang.Object symbol)
public final java.lang.Object getSymbol()
public final void setSymbol(java.lang.Object symbol)
public final Declaration nextDecl()
public final void setNext(Declaration next)
public Variable getVariable()
public final boolean isSimple()
public final void setSimple(boolean b)
public final void setSyntax()
public final ScopeExp getContext()
public void load(Declaration owner, int flags, Compilation comp, Target target)
public void compileStore(Compilation comp)
public final Expression getValue()
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.
public final void setValue(Expression value)
public final java.lang.Object getConstantValue()
public final boolean needsExternalAccess()
public final boolean needsContext()
public final boolean getFlag(int flag)
public final void setFlag(boolean setting, int flag)
public final void setFlag(int flag)
public final boolean isPublic()
public final boolean isPrivate()
public final void setPrivate(boolean isPrivate)
public short getAccessFlags(short defaultFlags)
public final boolean isAlias()
public final void setAlias(boolean flag)
public final boolean isFluid()
public final void setFluid(boolean fluid)
public final boolean isProcedureDecl()
public final void setProcedureDecl(boolean val)
public final boolean isNamespaceDecl()
public final boolean isIndirectBinding()
INDIRECT_BINDING
public final void setIndirectBinding(boolean indirectBinding)
INDIRECT_BINDING
public final boolean getCanRead()
public final void setCanRead(boolean read)
public final void setCanRead()
public final boolean getCanCall()
public final void setCanCall(boolean called)
public final void setCanCall()
public final boolean getCanWrite()
public final void setCanWrite(boolean written)
public final void setCanWrite()
public final boolean isThisParameter()
public boolean ignorable()
public boolean needsInit()
public boolean isStatic()
public final boolean isLexical()
public void noteValue(Expression value)
public void pushIndirectBinding(Compilation comp)
public final Variable allocateVariable(CodeAttr code)
public final void setFile(java.lang.String filename)
public final void setLine(int lineno, int colno)
public final void setLine(int lineno)
public final java.lang.String getFile()
public final int getLine()
public final int getColumn()
public void printInfo(OutPort out)
public void printInfo(java.lang.StringBuffer sbuf)
public java.lang.String toString()
toString
in class java.lang.Object
public static Declaration followAliases(Declaration decl)
public void makeField(Compilation comp, Expression value)
public void makeField(ClassType frameType, Compilation comp, Expression value)
public static Declaration getDeclarationFromStatic(java.lang.String cname, java.lang.String fname)
cname
- name of class containing fieldfname
- name of static fieldpublic static Declaration getDeclaration(Named proc)
public static Declaration getDeclaration(java.lang.Object proc, java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |