Java Doc for Expression.java in  » 6.0-JDK-Modules-sun » tools » sun » tools » tree » 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 » 6.0 JDK Modules sun » tools » sun.tools.tree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.tools.tree.Node
      sun.tools.tree.Expression

All known Subclasses:   sun.tools.tree.ThisExpression,  sun.tools.tree.InlineNewInstanceExpression,  sun.tools.tree.UnaryExpression,  sun.tools.tree.TypeExpression,  sun.tools.tree.InlineMethodExpression,  sun.tools.tree.IdentifierExpression,  sun.tools.tree.ConstantExpression,
Expression
public class Expression extends Node (Code)
WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.


Field Summary
 Typetype
    

Constructor Summary
 Expression(int op, long where, Type type)
    

Method Summary
public  Vsetcheck(Environment env, Context ctx, Vset vset, Hashtable exp)
    
public  VsetcheckAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, UnaryExpression loc)
     Check something that might be an AmbiguousName (refman 6.5.2). A string of dot-separated identifiers might be, in order of preference:
  • a variable name followed by fields or types
  • a type name followed by fields or types
  • a package name followed a type and then fields or types If a type name is found, it rewrites itself as a TypeExpression. If a node decides it can only be a package prefix, it sets its type to Type.tPackage.
  • public  VsetcheckAssignOp(Environment env, Context ctx, Vset vset, Hashtable exp, Expression outside)
        
    public  ConditionVarscheckCondition(Environment env, Context ctx, Vset vset, Hashtable exp)
         Check a condition.
    public  voidcheckCondition(Environment env, Context ctx, Vset vset, Hashtable exp, ConditionVars cvars)
        
    public  VsetcheckInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp)
        
    public  VsetcheckLHS(Environment env, Context ctx, Vset vset, Hashtable exp)
        
    public  VsetcheckValue(Environment env, Context ctx, Vset vset, Hashtable exp)
        
    public  voidcode(Environment env, Context ctx, Assembler asm)
        
     voidcodeAppend(Environment env, Context ctx, Assembler asm, ClassDeclaration sbClass, boolean needBuffer)
         Convert this expression to a string and append it to the string buffer on the top of the stack.
     voidcodeBranch(Environment env, Context ctx, Assembler asm, Label lbl, boolean whenTrue)
        
     voidcodeConversion(Environment env, Context ctx, Assembler asm, Type f, Type t)
        
     voidcodeDup(Environment env, Context ctx, Assembler asm, int items, int depth)
        
     intcodeLValue(Environment env, Context ctx, Assembler asm)
        
     voidcodeLoad(Environment env, Context ctx, Assembler asm)
        
     voidcodeStore(Environment env, Context ctx, Assembler asm)
        
    public  voidcodeValue(Environment env, Context ctx, Assembler asm)
        
    public  ExpressioncopyInline(Context ctx)
        
    public  intcostInline(int thresh, Environment env, Context ctx)
         The cost of inlining this expression.
     voidensureString(Environment env, Context ctx, Assembler asm)
         Convert this expression to a string.
    public  booleanequals(int i)
         Check if the expression is known to be equal to a given value.
    public  booleanequals(boolean b)
        
    public  booleanequals(Identifier id)
        
    public  booleanequals(String s)
        
    public  booleanequalsDefault()
        
     Expressioneval()
         Evaluate. Attempt to compute the value of an expression node.
    public  ExpressionfirstConstructor()
        
    public  booleanfitsType(Environment env, Context ctx, Type t)
         See if this expression fits in the given type. This is useful because some larger numbers fit into smaller types.

    If it is an "int" constant expression, inline it, if necessary, to examine its numerical value.

    public  booleanfitsType(Environment env, Type t)
        
    public  FieldUpdatergetAssigner(Environment env, Context ctx)
         Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment. This is used for implementing assignments to private fields for which an access method is required.
    public  ExpressiongetImplementation()
         Type checking may assign a more complex implementation to an innocuous-looking expression (like an identifier). Return that implementation, or the original expression itself if there is no special implementation.

    This appears at present to be dead code, and is not called from within javac.

    public  TypegetType()
        
    public  FieldUpdatergetUpdater(Environment env, Context ctx)
         Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment.
    public  ObjectgetValue()
         Return the constant value.
    public  Expressioninline(Environment env, Context ctx)
         Inline. Recursively simplify each child of an expression node, destructively replacing the child with the simplified result.
    public  ExpressioninlineLHS(Environment env, Context ctx)
        
    public  ExpressioninlineValue(Environment env, Context ctx)
        
    protected  StringBufferinlineValueSB(Environment env, Context ctx, StringBuffer buffer)
         Attempt to evaluate this expression.
    public  booleanisConstant()
         Return true if constant, according to JLS 15.27.
    public  booleanisNonNull()
         Check if the expression cannot be a null reference.
    public  booleanisNull()
         Check if the expression must be a null reference.
    public  Expressionorder()
        
     intprecedence()
        
    public  voidprint(PrintStream out)
        
     Expressionsimplify()
         Simplify. Attempt to simplify an expression node by returning a semantically- equivalent expression that is presumably less costly to execute.
     TypetoType(Environment env, Context ctx)
        

    Field Detail
    type
    Type type(Code)




    Constructor Detail
    Expression
    Expression(int op, long where, Type type)(Code)
    Constructor




    Method Detail
    check
    public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp)(Code)



    checkAmbigName
    public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, UnaryExpression loc)(Code)
    Check something that might be an AmbiguousName (refman 6.5.2). A string of dot-separated identifiers might be, in order of preference:
  • a variable name followed by fields or types
  • a type name followed by fields or types
  • a package name followed a type and then fields or types If a type name is found, it rewrites itself as a TypeExpression. If a node decides it can only be a package prefix, it sets its type to Type.tPackage. The caller must detect this and act appropriately to verify the full package name.



  • checkAssignOp
    public Vset checkAssignOp(Environment env, Context ctx, Vset vset, Hashtable exp, Expression outside)(Code)



    checkCondition
    public ConditionVars checkCondition(Environment env, Context ctx, Vset vset, Hashtable exp)(Code)
    Check a condition. Return a ConditionVars(), which indicates when which variables are set if the condition is true, and which are set if the condition is false.



    checkCondition
    public void checkCondition(Environment env, Context ctx, Vset vset, Hashtable exp, ConditionVars cvars)(Code)



    checkInitializer
    public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp)(Code)



    checkLHS
    public Vset checkLHS(Environment env, Context ctx, Vset vset, Hashtable exp)(Code)



    checkValue
    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp)(Code)
    Check an expression



    code
    public void code(Environment env, Context ctx, Assembler asm)(Code)



    codeAppend
    void codeAppend(Environment env, Context ctx, Assembler asm, ClassDeclaration sbClass, boolean needBuffer) throws ClassNotFound, AmbiguousMember(Code)
    Convert this expression to a string and append it to the string buffer on the top of the stack. If the needBuffer argument is true, the string buffer needs to be created, initialized, and pushed on the stack, first.



    codeBranch
    void codeBranch(Environment env, Context ctx, Assembler asm, Label lbl, boolean whenTrue)(Code)
    Code



    codeConversion
    void codeConversion(Environment env, Context ctx, Assembler asm, Type f, Type t)(Code)



    codeDup
    void codeDup(Environment env, Context ctx, Assembler asm, int items, int depth)(Code)
    Code



    codeLValue
    int codeLValue(Environment env, Context ctx, Assembler asm)(Code)



    codeLoad
    void codeLoad(Environment env, Context ctx, Assembler asm)(Code)



    codeStore
    void codeStore(Environment env, Context ctx, Assembler asm)(Code)



    codeValue
    public void codeValue(Environment env, Context ctx, Assembler asm)(Code)



    copyInline
    public Expression copyInline(Context ctx)(Code)
    Create a copy of the expression for method inlining



    costInline
    public int costInline(int thresh, Environment env, Context ctx)(Code)
    The cost of inlining this expression. This cost controls the inlining of methods, and does not determine the compile-time simplifications performed by 'inline' and friends.



    ensureString
    void ensureString(Environment env, Context ctx, Assembler asm) throws ClassNotFound, AmbiguousMember(Code)
    Convert this expression to a string.



    equals
    public boolean equals(int i)(Code)
    Check if the expression is known to be equal to a given value. Returns false for any expression other than a literal constant, thus should be called only after simplification (inlining) has been performed.



    equals
    public boolean equals(boolean b)(Code)



    equals
    public boolean equals(Identifier id)(Code)



    equals
    public boolean equals(String s)(Code)



    equalsDefault
    public boolean equalsDefault()(Code)
    Check if the expression is equal to its default static value



    eval
    Expression eval()(Code)
    Evaluate. Attempt to compute the value of an expression node. If all operands are literal constants of the same kind (e.g., IntegerExpression nodes), a new constant node of the proper type is returned representing the value as computed at compile-time. Otherwise, the original node 'this' is returned.



    firstConstructor
    public Expression firstConstructor()(Code)
    Check if the first thing is a constructor invocation



    fitsType
    public boolean fitsType(Environment env, Context ctx, Type t)(Code)
    See if this expression fits in the given type. This is useful because some larger numbers fit into smaller types.

    If it is an "int" constant expression, inline it, if necessary, to examine its numerical value. See JLS 5.2 and 15.24.




    fitsType
    public boolean fitsType(Environment env, Type t)(Code)



    getAssigner
    public FieldUpdater getAssigner(Environment env, Context ctx)(Code)
    Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment. This is used for implementing assignments to private fields for which an access method is required. Returns null if no access method is needed, in which case the assignment is handled in the usual way, by direct access. Only simple assignment expressions are handled here Assignment operators and pre/post increment/decrement operators are are handled by 'getUpdater' below.

    Called during the checking phase.




    getImplementation
    public Expression getImplementation()(Code)
    Type checking may assign a more complex implementation to an innocuous-looking expression (like an identifier). Return that implementation, or the original expression itself if there is no special implementation.

    This appears at present to be dead code, and is not called from within javac. Access to the implementation generally occurs within the same class, and thus uses the underlying field directly.




    getType
    public Type getType()(Code)



    getUpdater
    public FieldUpdater getUpdater(Environment env, Context ctx)(Code)
    Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment. This is used for implementing the assignment operators and the increment/decrement operators on private fields that require an access method, e.g., uplevel from an inner class. Returns null if no access method is needed.

    Called during the checking phase.




    getValue
    public Object getValue()(Code)
    Return the constant value.



    inline
    public Expression inline(Environment env, Context ctx)(Code)
    Inline. Recursively simplify each child of an expression node, destructively replacing the child with the simplified result. Also attempts to simplify the current node 'this', and returns the simplified result. The name 'inline' is somthing of a misnomer, as these methods are responsible for compile-time expression simplification in general. The 'eval' and 'simplify' methods apply to a single expression node only -- it is 'inline' and 'inlineValue' that drive the simplification of entire expressions.



    inlineLHS
    public Expression inlineLHS(Environment env, Context ctx)(Code)



    inlineValue
    public Expression inlineValue(Environment env, Context ctx)(Code)



    inlineValueSB
    protected StringBuffer inlineValueSB(Environment env, Context ctx, StringBuffer buffer)(Code)
    Attempt to evaluate this expression. If this expression yields a value, append it to the StringBuffer `buffer'. If this expression cannot be evaluated at this time (for example if it contains a division by zero, a non-constant subexpression, or a subexpression which "refuses" to evaluate) then return `null' to indicate failure. It is anticipated that this method will be called to evaluate concatenations of compile-time constant strings. The call originates from AddExpression#inlineValue(). See AddExpression#inlineValueSB() for detailed comments.



    isConstant
    public boolean isConstant()(Code)
    Return true if constant, according to JLS 15.27. A constant expression must inline away to a literal constant.



    isNonNull
    public boolean isNonNull()(Code)
    Check if the expression cannot be a null reference.



    isNull
    public boolean isNull()(Code)
    Check if the expression must be a null reference.



    order
    public Expression order()(Code)
    Order the expression based on precedence



    precedence
    int precedence()(Code)
    Return the precedence of the operator



    print
    public void print(PrintStream out)(Code)
    Print



    simplify
    Expression simplify()(Code)
    Simplify. Attempt to simplify an expression node by returning a semantically- equivalent expression that is presumably less costly to execute. There is some overlap with the intent of 'eval', as compile-time evaluation of conditional expressions and the short-circuit boolean operators is performed here. Other simplifications include logical identities involving logical negation and comparisons. If no simplification is possible, the original node 'this' is returned. It is assumed that the children of the node have previously been recursively simplified and evaluated. A result of 'null' indicates that the expression may be elided entirely.



    toType
    Type toType(Environment env, Context ctx)(Code)
    Convert an expresion to a type



    Fields inherited from sun.tools.tree.Node
    int op(Code)(Java Doc)
    long where(Code)(Java Doc)

    Methods inherited from sun.tools.tree.Node
    public Object clone()(Code)(Java Doc)
    public Expression convert(Environment env, Context ctx, Type t, Expression e)(Code)(Java Doc)
    public int getOp()(Code)(Java Doc)
    public long getWhere()(Code)(Java Doc)
    public void print(PrintStream out)(Code)(Java Doc)
    public String toString()(Code)(Java Doc)

    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.