Java Doc for Declaration.java in  » Scripting » Nice » 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 » Nice » gnu.expr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gnu.expr.Declaration

Declaration
public class Declaration (Code)
The static information associated with a local variable binding.

These are the kinds of Declaration we use:

A local variable that is not captured by an inner lambda is stored in a Java local variables slot (register). The predicate isSimple () is true, and offset is the number of the local variable slot.

If a local variable is captured by an inner lambda, the variable is stored in a field of the LambdaExp's heapFrame variable. (The latter declaration has isSimple and isArtificial true.) The Declaration's field specifies the Field used. If a function takes a fixed number of parameters, at most four, then the arguments are passed in Java registers 1..4. If a parameter is not captured by an inner lambda, the parameter has the flags isSimple and isParameter true.

A parameter named "foo" that is captured by an inner lambda is represented using two Declarations, named "foo" and "fooIncoming". The "fooIncoming" declaration is the actual parameter as passed by the caller using a Java local variable slot. It has isParameter(), isSimple(), and isArtificial set. The "foo" Declaration has isParameter() set. The procedure prologue copies "fooIncoming" to "foo", which acts just like a normal captured local variable.

If a function takes more than 4 or a variable number of parameters, the arguments are passed in an array (using the applyN virtual method). This array is referenced by the argsArray declaration, which has isSimple(), isParameter(), and isArtificial() true, and its offset is 1. The parameters are copied into the program-named variables by the procedure prologue, so the parameters henceforth act like local variables.
author:
   Per Bothner



Field Summary
final static  intCAN_CALL
    
final static  intCAN_READ
    
final static  intCAN_WRITE
    
final public static  intEXPORT_SPECIFIED
    
final static  intINDIRECT_BINDING
    
final static  intIS_ALIAS
    
final public static  intIS_CONSTANT
    
final static  intIS_FLUID
    
final static  intIS_SIMPLE
    
final public static  intIS_SINGLE_VALUE
    
final public static  intIS_SYNTAX
    
final public static  intIS_UNKNOWN
    
final public static  intNONSTATIC_SPECIFIED
    
final public static  intNOT_DEFINING
     Set if this is just a declaration, not a definition.
final public static  intNOT_INITIALIZED
    
final static  intPRIVATE
    
final public static  intPRIVATE_SPECIFIED
    
final static  intPROCEDURE
    
final public static  intSTATIC_SPECIFIED
    
final public static  intTRANSIENT
    
final public static  intTYPE_SPECIFIED
    
final public static  intVOLATILE
    
public  Declarationbase
     If non-null, field is relative to base. If IS_FLUID, base points to IS_UNKNOWN Binding.
public  ScopeExpcontext
    
static  intcounter
    
public  Fieldfield
    
 Stringfilename
    
public  ApplyExpfirstCall
     List of ApplyExp where this declaration is the function called. The applications are chained using their nextcall fields.
protected  intflags
    
protected  intid
     Unique id number, to ease print-outs and debugging.
 MethodmakeBindingMethod
    
 Stringname
     The (interned) name of the new variable. This is the source-level (non-mangled) name.
 Declarationnext
    
 DeclarationnextCapturedVar
     Used to link Declarations in a LambdaExp's capturedVars list.
 intposition
    
protected  Typetype
    
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(String name)
    
public  Declaration(String s, Type type)
    
public  Declaration(String name, Field field)
    

Method Summary
final public  VariableallocateVariable(CodeAttr code)
    
public  voidcompileStore(Compilation comp)
    
public static  DeclarationfollowAliases(Declaration decl)
    
final public  booleangetCanCall()
    
final public  booleangetCanRead()
    
final public  booleangetCanWrite()
    
final public  intgetColumn()
    
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)
    
final public  StringgetFile()
    
final public  booleangetFlag(int flag)
    
final public  intgetLine()
     Get the line number of (the start of) this Expression. The "first" line is line 1.
final public  StringgetName()
    
final public  TypegetType()
    
final public  ExpressiongetValue()
    
public  VariablegetVariable()
    
public  booleanignorable()
     True if we never need to access this declaration.
public  voidinitBinding(Compilation comp)
     Generate code to initialize the location for this. Assume the initial value is already pushed on the stack.
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 Binding.
final public  booleanisLexical()
    
final public  booleanisPrivate()
    
final public  booleanisProcedureDecl()
    
final public  booleanisPublic()
    
final public  booleanisSimple()
    
final public  booleanisSpecifiedPrivate()
    
public  booleanisStatic()
    
public  voidload(Compilation comp)
    
public  voidloadOwningObject(Compilation comp)
     If this is a field in some object, load a reference to that object.
public  voidmakeField(Compilation comp, Expression value)
    
public  booleanneedsInit()
    
final public  DeclarationnextDecl()
    
public  voidnoteValue(Expression value)
    
public  voidpushIndirectBinding(Compilation comp)
     Create a Binding object, given that isIndirectBinding(). Assume the initial value is already pushed on the stack; leaves initialized Binding 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()
    
 voidsetFieldValue(Compilation comp)
    
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)
    
final public  voidsetLine(int lineno, int colno)
    
final public  voidsetLine(int lineno)
    
public  voidsetName(String name)
    
final public  voidsetPrivate(boolean isPrivate)
    
final public  voidsetProcedureDecl(boolean val)
    
final public  voidsetSimple(boolean b)
    
final public  voidsetSpecifiedPrivate(boolean isPrivate)
    
final public  voidsetType(Type type)
    
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)



EXPORT_SPECIFIED
final public static int EXPORT_SPECIFIED(Code)



INDIRECT_BINDING
final static int INDIRECT_BINDING(Code)



IS_ALIAS
final static int IS_ALIAS(Code)



IS_CONSTANT
final public static int IS_CONSTANT(Code)



IS_FLUID
final static int IS_FLUID(Code)



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)



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.



NOT_INITIALIZED
final public static int NOT_INITIALIZED(Code)



PRIVATE
final static int PRIVATE(Code)



PRIVATE_SPECIFIED
final public static int PRIVATE_SPECIFIED(Code)



PROCEDURE
final static int PROCEDURE(Code)



STATIC_SPECIFIED
final public static int STATIC_SPECIFIED(Code)



TRANSIENT
final public static int TRANSIENT(Code)



TYPE_SPECIFIED
final public static int TYPE_SPECIFIED(Code)



VOLATILE
final public static int VOLATILE(Code)



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



context
public ScopeExp context(Code)



counter
static int counter(Code)



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.



flags
protected int flags(Code)



id
protected int id(Code)
Unique id number, to ease print-outs and debugging.



makeBindingMethod
Method makeBindingMethod(Code)



name
String name(Code)
The (interned) name of the new variable. This is the source-level (non-mangled) name.



next
Declaration next(Code)



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



position
int position(Code)



type
protected Type type(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(String name)(Code)



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



Declaration
public Declaration(String 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)



getCanCall
final public boolean getCanCall()(Code)



getCanRead
final public boolean getCanRead()(Code)



getCanWrite
final public boolean getCanWrite()(Code)



getColumn
final public int getColumn()(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)



getFile
final public String getFile()(Code)



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



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



getName
final public String getName()(Code)



getType
final public Type getType()(Code)



getValue
final public Expression getValue()(Code)



getVariable
public Variable getVariable()(Code)



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



initBinding
public void initBinding(Compilation comp)(Code)
Generate code to initialize the location for this. Assume the initial value is already pushed on the stack.



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 Binding.



isLexical
final public boolean isLexical()(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)



isSpecifiedPrivate
final public boolean isSpecifiedPrivate()(Code)



isStatic
public boolean isStatic()(Code)



load
public void load(Compilation comp)(Code)



loadOwningObject
public void loadOwningObject(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)



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)



pushIndirectBinding
public void pushIndirectBinding(Compilation comp)(Code)
Create a Binding object, given that isIndirectBinding(). Assume the initial value is already pushed on the stack; leaves initialized Binding 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)



setFieldValue
void setFieldValue(Compilation comp)(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)



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



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



setName
public void setName(String name)(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)



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



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



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.