gnu.expr
public class Declaration extends Object implements SourceLocator
| Field Summary | |
|---|---|
| Declaration | base If non-null, field is relative to base.
|
| ScopeExp | context |
| static int | EARLY_INIT Initialize in {@code |
| static int | EXPORT_SPECIFIED |
| static int | EXTERNAL_ACCESS This flag bit is set if this can be be acceessed from other modules.
|
| Field | field |
| ApplyExp | firstCall List of ApplyExp where this declaration is the function called.
|
| protected int | flags |
| static int | FIELD_OR_METHOD True if this is a field or method in a class definition. |
| 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 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 |
| protected Expression | typeExp |
| static int | TYPE_SPECIFIED |
| protected Expression | value If non-null, the single expression used to set this variable.
|
| Constructor Summary | |
|---|---|
| protected | Declaration() |
| Declaration(Variable var) | |
| Declaration(Object name) | |
| Declaration(Object s, Type type) | |
| Declaration(Object name, Field field) | |
| 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 | getColumnNumber() |
| 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(Object proc, String name) |
| static Declaration | getDeclarationFromStatic(String cname, String fname) Create a declaration corresponding to a static field. |
| static Declaration | getDeclarationValueFromStatic(String className, String fieldName, String name) Similar to {@code getDeclarationFromStatic},
but also do {@code noteValue} with the field's value. |
| String | getFileName() |
| boolean | getFlag(int flag) |
| int | getLineNumber() Get the line number of (the start of) this Expression.
|
| String | getName() |
| String | getPublicId() |
| Object | getSymbol() |
| String | getSystemId() |
| Type | getType() |
| Expression | getTypeExp() |
| 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 | isStableSourceLocation() |
| boolean | isStatic() |
| boolean | isThisParameter() Is this an implicit 'this' parameter? |
| static boolean | isUnknown(Declaration decl) |
| void | load(AccessExp access, int flags, Compilation comp, Target target) |
| void | makeField(Compilation comp, Expression value) |
| void | makeField(ClassType frameType, 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(StringBuffer sbuf) |
| void | pushIndirectBinding(Compilation comp) Create a Location object, given that isIndirectBinding().
|
| void | setAlias(boolean flag) |
| void | setCanCall(boolean called) |
| void | setCanCall() |
| void | setCanRead(boolean read) |
| void | setCanRead() |
| void | setCanWrite(boolean written) |
| void | setCanWrite() |
| void | setCode(int code) |
| void | setFile(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, int colno) |
| void | setLine(int lineno) |
| void | setLocation(SourceLocator location) |
| void | setName(Object symbol) |
| void | setNext(Declaration next) |
| void | setPrivate(boolean isPrivate) |
| void | setProcedureDecl(boolean val) |
| void | setSimple(boolean b) |
| void | setSymbol(Object symbol) |
| void | setSyntax() |
| void | setType(Type type) |
| void | setTypeExp(Expression typeExp) |
| void | setValue(Expression value) Set the value assoociated with this Declaration.
|
| String | toString() |
Parameters: cname name of class containing field fname name of static field
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.See Also: INDIRECT_BINDING
See Also: INDIRECT_BINDING