Java Doc for Declaration.java in  » Scripting » Kawa » gnu » expr » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » Kawa » gnu.expr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gnu.expr.Declaration

Declaration
public class Declaration implements SourceLocator(Code)
The static information associated with a local variable binding.
author:
   Per Bothner
author:
   These are the kinds of Declaration we use:
author:
   A local variable that is not captured by an inner lambda is stored
author:
   in a Java local variables slot (register). The predicate isSimple ()
author:
   is true, and offset is the number of the local variable slot.
author:
   If a local variable is captured by an inner lambda, the
author:
   variable is stored in a field of the LambdaExp's heapFrame variable.
author:
   (The latter declaration has isSimple and isArtificial true.)
author:
   The Declaration's field specifies the Field used.
author:
   If a function takes a fixed number of parameters, at most four,
author:
   then the arguments are passed in Java registers 1..4.
author:
   If a parameter is not captured by an inner lambda, the parameter
author:
   has the flags isSimple and isParameter true.
author:
   If a function takes more than 4 or a variable number of parameters,
author:
   the arguments are passed in an array (using the applyN virtual method).
author:
   This array is referenced by the argsArray declaration, which has
author:
   isSimple(), isParameter(), and isArtificial() true, and its offset is 1.
author:
   The parameters are copied into the program-named variables by the
author:
   procedure prologue, so the parameters henceforth act like local variables.


Field Summary
final static  intCAN_CALL
    
final static  intCAN_READ
    
final static  intCAN_WRITE
    
final public static  intEARLY_INIT
     Initialize in / rather than in run / $run$ >.
final public static  intEXPORT_SPECIFIED
    
final public static  intEXTERNAL_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.
final public static  intFIELD_OR_METHOD
     True if this is a field or method in a class definition.
final static  intINDIRECT_BINDING
     If this flag is set then to get the actual value you have to dereference a gnu.mapping.Location.
final public static  intIS_ALIAS
    
final public static  intIS_CONSTANT
    
final public static  intIS_DYNAMIC
    
final static  intIS_FLUID
    
final public static  intIS_IMPORTED
    
final public static  intIS_NAMESPACE_PREFIX
     Set if this declares a namespace prefix (as in XML namespaces).
final static  intIS_SIMPLE
    
final public static  intIS_SINGLE_VALUE
    
final public static  intIS_SYNTAX
    
final public static  intIS_UNKNOWN
    
final public static  intMODULE_REFERENCE
     A reference to a module instance.
final public static  intNONSTATIC_SPECIFIED
    
final public static  intNOT_DEFINING
     Set if this is just a declaration, not a definition.
final public static  intPACKAGE_ACCESS
    
final static  intPRIVATE
    
final public static  intPRIVATE_ACCESS
    
final public static  StringPRIVATE_PREFIX
     This prefix is used in field names for a declaration that has both EXTERNAL_ACCESS and IS_PRIVATE set.
final public static  intPRIVATE_SPECIFIED
    
final static  intPROCEDURE
     True if in the function namespace, for languages that distinguishes them. I.e.
final public static  intPROTECTED_ACCESS
    
final public static  intPUBLIC_ACCESS
    
final public static  intSTATIC_SPECIFIED
    
final public static  intTYPE_SPECIFIED
    
final static  StringUNKNOWN_PREFIX
     This prefix is prepended to field names for unknown names.
public  Declarationbase
     If non-null, field is relative to base. If IS_FLUID, base points to IS_UNKNOWN Symbol.
public  ScopeExpcontext
    
static  intcounter
    
 intevalIndex
     Index in evalFrame for this scope, if interpreting.
public  Fieldfield
    
 Stringfilename
    
public  ApplyExpfirstCall
     List of ApplyExp where this declaration is the function called. The applications are chained using their nextCall fields. The chain is not built if STATIC_SPECIFIED.
protected  intflags
    
protected  intid
     Unique id number, to ease print-outs and debugging. If negative, a code to specify a builtin function.
 MethodmakeLocationMethod
    
 Declarationnext
    
 DeclarationnextCapturedVar
     Used to link Declarations in a LambdaExp's capturedVars list.
 intposition
    
 Objectsymbol
     The name of the new variable, either an interned String or a Symbol. This is the source-level (non-mangled) name.
protected  Typetype
    
protected  ExpressiontypeExp
    
protected  Expressionvalue
     If non-null, the single expression used to set this variable. If the variable can be set more than once, then value is null.
 Variablevar
    

Constructor Summary
protected  Declaration()
    
public  Declaration(Variable var)
    
public  Declaration(Object name)
    
public  Declaration(Object s, Type type)
    
public  Declaration(Object name, Field field)
    

Method Summary
final public  VariableallocateVariable(CodeAttr code)
    
public  voidcompileStore(Compilation comp)
    
public static  DeclarationfollowAliases(Declaration decl)
    
public  shortgetAccessFlags(short defaultFlags)
    
final public  booleangetCanCall()
    
final public  booleangetCanRead()
    
final public  booleangetCanWrite()
    
public  intgetCode()
    
final public  intgetColumnNumber()
    
final public  ObjectgetConstantValue()
     If getValue() is a constant, return the constant value, otherwise null.
final public  ScopeExpgetContext()
     Return the ScopeExp that contains (declares) this Declaration.
public static  DeclarationgetDeclaration(Named proc)
    
public static  DeclarationgetDeclaration(Object proc, String name)
    
public static  DeclarationgetDeclarationFromStatic(String cname, String fname)
     Create a declaration corresponding to a static field.
public static  DeclarationgetDeclarationValueFromStatic(String className, String fieldName, String name)
     Similar to getDeclarationFromStatic , but also do noteValue with the field's value.
final public  StringgetFileName()
    
final public  booleangetFlag(int flag)
    
final public  intgetLineNumber()
     Get the line number of (the start of) this Expression. The "first" line is line 1; unknown is -1.
final public  StringgetName()
    
public  StringgetPublicId()
    
final public  ObjectgetSymbol()
    
public  StringgetSystemId()
    
final public  TypegetType()
    
final public  ExpressiongetTypeExp()
    
final public  ExpressiongetValue()
     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.
public  VariablegetVariable()
    
public  booleanignorable()
     True if we never need to access this declaration.
final public  booleanisAlias()
    
final public  booleanisFluid()
     True if this is a fluid binding (in a FluidLetExp).
final public  booleanisIndirectBinding()
     True if the value of the variable is the contents of a Location.
final public  booleanisLexical()
    
final public  booleanisNamespaceDecl()
    
final public  booleanisPrivate()
    
final public  booleanisProcedureDecl()
    
final public  booleanisPublic()
    
final public  booleanisSimple()
    
public  booleanisStableSourceLocation()
    
public  booleanisStatic()
    
final public  booleanisThisParameter()
    
final public static  booleanisUnknown(Declaration decl)
    
public  voidload(AccessExp access, int flags, Compilation comp, Target target)
    
 voidloadOwningObject(Declaration owner, Compilation comp)
     If this is a field in some object, load a reference to that object.
public  voidmakeField(Compilation comp, Expression value)
    
public  voidmakeField(ClassType frameType, Compilation comp, Expression value)
    
 gnu.mapping.LocationmakeIndirectLocationFor()
    
final public  booleanneedsContext()
     If we need a 'context' supplied from a ReferenceExp or 'this.
final public  booleanneedsExternalAccess()
    
public  booleanneedsInit()
    
final public  DeclarationnextDecl()
    
public  voidnoteValue(Expression value)
    
public  voidprintInfo(OutPort out)
    
public  voidprintInfo(StringBuffer sbuf)
    
public  voidpushIndirectBinding(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.
final public  voidsetAlias(boolean flag)
    
final public  voidsetCanCall(boolean called)
    
final public  voidsetCanCall()
    
final public  voidsetCanRead(boolean read)
    
final public  voidsetCanRead()
    
final public  voidsetCanWrite(boolean written)
    
final public  voidsetCanWrite()
    
public  voidsetCode(int code)
    
final public  voidsetFile(String filename)
    
final public  voidsetFlag(boolean setting, int flag)
    
final public  voidsetFlag(int flag)
    
final public  voidsetFluid(boolean fluid)
    
final public  voidsetIndirectBinding(boolean indirectBinding)
     Note that the value of the variable is the contents of a Location.
final public  voidsetLine(int lineno, int colno)
    
final public  voidsetLine(int lineno)
    
final public  voidsetLocation(SourceLocator location)
    
final public  voidsetName(Object symbol)
    
final public  voidsetNext(Declaration next)
    
final public  voidsetPrivate(boolean isPrivate)
    
final public  voidsetProcedureDecl(boolean val)
    
final public  voidsetSimple(boolean b)
    
final public  voidsetSymbol(Object symbol)
    
final public  voidsetSyntax()
    
final public  voidsetType(Type type)
    
final public  voidsetTypeExp(Expression typeExp)
    
final public  voidsetValue(Expression value)
     Set the value assoociated with this Declaration. Most code should use noteValue instead.
public  StringtoString()
    

Field Detail
CAN_CALL
final static int CAN_CALL(Code)



CAN_READ
final static int CAN_READ(Code)



CAN_WRITE
final static int CAN_WRITE(Code)



EARLY_INIT
final public static int EARLY_INIT(Code)
Initialize in / rather than in run / $run$ >.



EXPORT_SPECIFIED
final public static int EXPORT_SPECIFIED(Code)



EXTERNAL_ACCESS
final public static int EXTERNAL_ACCESS(Code)
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
final public static int FIELD_OR_METHOD(Code)
True if this is a field or method in a class definition.



INDIRECT_BINDING
final static int INDIRECT_BINDING(Code)
If this flag is set then to get the actual value you have to dereference a gnu.mapping.Location. I.e. this Declaration's var or field does not contain the Declaration's value directly, but rather yields a Location that contains the Declaration's value. Note that this flag indicates the representation: The result of getValue() is not the location, but the semantic value. after dereferencing. Likewise getType is the value after de-referencing, not a Location sub-class.



IS_ALIAS
final public static int IS_ALIAS(Code)



IS_CONSTANT
final public static int IS_CONSTANT(Code)



IS_DYNAMIC
final public static int IS_DYNAMIC(Code)



IS_FLUID
final static int IS_FLUID(Code)



IS_IMPORTED
final public static int IS_IMPORTED(Code)



IS_NAMESPACE_PREFIX
final public static int IS_NAMESPACE_PREFIX(Code)
Set if this declares a namespace prefix (as in XML namespaces).



IS_SIMPLE
final static int IS_SIMPLE(Code)



IS_SINGLE_VALUE
final public static int IS_SINGLE_VALUE(Code)



IS_SYNTAX
final public static int IS_SYNTAX(Code)



IS_UNKNOWN
final public static int IS_UNKNOWN(Code)



MODULE_REFERENCE
final public static int MODULE_REFERENCE(Code)
A reference to a module instance.



NONSTATIC_SPECIFIED
final public static int NONSTATIC_SPECIFIED(Code)



NOT_DEFINING
final public static int NOT_DEFINING(Code)
Set if this is just a declaration, not a definition.



PACKAGE_ACCESS
final public static int PACKAGE_ACCESS(Code)



PRIVATE
final static int PRIVATE(Code)



PRIVATE_ACCESS
final public static int PRIVATE_ACCESS(Code)



PRIVATE_PREFIX
final public static String PRIVATE_PREFIX(Code)
This prefix is used in field names for a declaration that has both EXTERNAL_ACCESS and IS_PRIVATE set.



PRIVATE_SPECIFIED
final public static int PRIVATE_SPECIFIED(Code)



PROCEDURE
final static int PROCEDURE(Code)
True if in the function namespace, for languages that distinguishes them. I.e. a function definition or macro definition.



PROTECTED_ACCESS
final public static int PROTECTED_ACCESS(Code)



PUBLIC_ACCESS
final public static int PUBLIC_ACCESS(Code)



STATIC_SPECIFIED
final public static int STATIC_SPECIFIED(Code)



TYPE_SPECIFIED
final public static int TYPE_SPECIFIED(Code)



UNKNOWN_PREFIX
final static String UNKNOWN_PREFIX(Code)
This prefix is prepended to field names for unknown names.



base
public Declaration base(Code)
If non-null, field is relative to base. If IS_FLUID, base points to IS_UNKNOWN Symbol.



context
public ScopeExp context(Code)



counter
static int counter(Code)



evalIndex
int evalIndex(Code)
Index in evalFrame for this scope, if interpreting.



field
public Field field(Code)



filename
String filename(Code)



firstCall
public ApplyExp firstCall(Code)
List of ApplyExp where this declaration is the function called. The applications are chained using their nextCall fields. The chain is not built if STATIC_SPECIFIED.



flags
protected int flags(Code)



id
protected int id(Code)
Unique id number, to ease print-outs and debugging. If negative, a code to specify a builtin function.



makeLocationMethod
Method makeLocationMethod(Code)



next
Declaration next(Code)



nextCapturedVar
Declaration nextCapturedVar(Code)
Used to link Declarations in a LambdaExp's capturedVars list.



position
int position(Code)



symbol
Object symbol(Code)
The name of the new variable, either an interned String or a Symbol. This is the source-level (non-mangled) name.



type
protected Type type(Code)



typeExp
protected Expression typeExp(Code)



value
protected Expression value(Code)
If non-null, the single expression used to set this variable. If the variable can be set more than once, then value is null.



var
Variable var(Code)




Constructor Detail
Declaration
protected Declaration()(Code)



Declaration
public Declaration(Variable var)(Code)



Declaration
public Declaration(Object name)(Code)



Declaration
public Declaration(Object s, Type type)(Code)



Declaration
public Declaration(Object name, Field field)(Code)




Method Detail
allocateVariable
final public Variable allocateVariable(CodeAttr code)(Code)



compileStore
public void compileStore(Compilation comp)(Code)



followAliases
public static Declaration followAliases(Declaration decl)(Code)



getAccessFlags
public short getAccessFlags(short defaultFlags)(Code)



getCanCall
final public boolean getCanCall()(Code)



getCanRead
final public boolean getCanRead()(Code)



getCanWrite
final public boolean getCanWrite()(Code)



getCode
public int getCode()(Code)



getColumnNumber
final public int getColumnNumber()(Code)



getConstantValue
final public Object getConstantValue()(Code)
If getValue() is a constant, return the constant value, otherwise null.



getContext
final public ScopeExp getContext()(Code)
Return the ScopeExp that contains (declares) this Declaration.



getDeclaration
public static Declaration getDeclaration(Named proc)(Code)



getDeclaration
public static Declaration getDeclaration(Object proc, String name)(Code)



getDeclarationFromStatic
public static Declaration getDeclarationFromStatic(String cname, String fname)(Code)
Create a declaration corresponding to a static field.
Parameters:
  cname - name of class containing field
Parameters:
  fname - name of static field



getDeclarationValueFromStatic
public static Declaration getDeclarationValueFromStatic(String className, String fieldName, String name)(Code)
Similar to getDeclarationFromStatic , but also do noteValue with the field's value.



getFileName
final public String getFileName()(Code)



getFlag
final public boolean getFlag(int flag)(Code)



getLineNumber
final public int getLineNumber()(Code)
Get the line number of (the start of) this Expression. The "first" line is line 1; unknown is -1.



getName
final public String getName()(Code)



getPublicId
public String getPublicId()(Code)



getSymbol
final public Object getSymbol()(Code)



getSystemId
public String getSystemId()(Code)



getType
final public Type getType()(Code)



getTypeExp
final public Expression getTypeExp()(Code)



getValue
final public Expression getValue()(Code)
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()(Code)



ignorable
public boolean ignorable()(Code)
True if we never need to access this declaration.



isAlias
final public boolean isAlias()(Code)



isFluid
final public boolean isFluid()(Code)
True if this is a fluid binding (in a FluidLetExp).



isIndirectBinding
final public boolean isIndirectBinding()(Code)
True if the value of the variable is the contents of a Location.
See Also:   Declaration.INDIRECT_BINDING
See Also:   



isLexical
final public boolean isLexical()(Code)



isNamespaceDecl
final public boolean isNamespaceDecl()(Code)



isPrivate
final public boolean isPrivate()(Code)



isProcedureDecl
final public boolean isProcedureDecl()(Code)



isPublic
final public boolean isPublic()(Code)



isSimple
final public boolean isSimple()(Code)



isStableSourceLocation
public boolean isStableSourceLocation()(Code)



isStatic
public boolean isStatic()(Code)



isThisParameter
final public boolean isThisParameter()(Code)
Is this an implicit 'this' parameter?



isUnknown
final public static boolean isUnknown(Declaration decl)(Code)



load
public void load(AccessExp access, int flags, Compilation comp, Target target)(Code)



loadOwningObject
void loadOwningObject(Declaration owner, Compilation comp)(Code)
If this is a field in some object, load a reference to that object.



makeField
public void makeField(Compilation comp, Expression value)(Code)



makeField
public void makeField(ClassType frameType, Compilation comp, Expression value)(Code)



makeIndirectLocationFor
gnu.mapping.Location makeIndirectLocationFor()(Code)



needsContext
final public boolean needsContext()(Code)
If we need a 'context' supplied from a ReferenceExp or 'this.



needsExternalAccess
final public boolean needsExternalAccess()(Code)



needsInit
public boolean needsInit()(Code)
Does this variable need to be initialized or is default ok



nextDecl
final public Declaration nextDecl()(Code)



noteValue
public void noteValue(Expression value)(Code)



printInfo
public void printInfo(OutPort out)(Code)



printInfo
public void printInfo(StringBuffer sbuf)(Code)



pushIndirectBinding
public void pushIndirectBinding(Compilation comp)(Code)
Create a Location object, given that isIndirectBinding(). Assume the initial value is already pushed on the stack; leaves initialized Location object on stack.



setAlias
final public void setAlias(boolean flag)(Code)



setCanCall
final public void setCanCall(boolean called)(Code)



setCanCall
final public void setCanCall()(Code)



setCanRead
final public void setCanRead(boolean read)(Code)



setCanRead
final public void setCanRead()(Code)



setCanWrite
final public void setCanWrite(boolean written)(Code)



setCanWrite
final public void setCanWrite()(Code)



setCode
public void setCode(int code)(Code)



setFile
final public void setFile(String filename)(Code)



setFlag
final public void setFlag(boolean setting, int flag)(Code)



setFlag
final public void setFlag(int flag)(Code)



setFluid
final public void setFluid(boolean fluid)(Code)



setIndirectBinding
final public void setIndirectBinding(boolean indirectBinding)(Code)
Note that the value of the variable is the contents of a Location.
See Also:   Declaration.INDIRECT_BINDING
See Also:   



setLine
final public void setLine(int lineno, int colno)(Code)



setLine
final public void setLine(int lineno)(Code)



setLocation
final public void setLocation(SourceLocator location)(Code)



setName
final public void setName(Object symbol)(Code)



setNext
final public void setNext(Declaration next)(Code)



setPrivate
final public void setPrivate(boolean isPrivate)(Code)



setProcedureDecl
final public void setProcedureDecl(boolean val)(Code)



setSimple
final public void setSimple(boolean b)(Code)



setSymbol
final public void setSymbol(Object symbol)(Code)



setSyntax
final public void setSyntax()(Code)



setType
final public void setType(Type type)(Code)



setTypeExp
final public void setTypeExp(Expression typeExp)(Code)



setValue
final public void setValue(Expression value)(Code)
Set the value assoociated with this Declaration. Most code should use noteValue instead.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.