Java Doc for Context.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.Context

All known Subclasses:   sun.tools.tree.CheckContext,  sun.tools.tree.CodeContext,
Context
public class Context implements Constants(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
 LocalMemberclasses
    
 MemberDefinitionfield
    
 intframeNumber
    
 LocalMemberlocals
    
 Nodenode
    
 Contextprev
    
 intscopeNumber
    
 intvarNumber
    

Constructor Summary
public  Context(Context ctx, MemberDefinition field)
    
public  Context(Context ctx, ClassDefinition c)
     Create a new context, for initializing a class.
 Context(Context ctx, Node node)
    
public  Context(Context ctx)
    

Method Summary
public  booleancanReach(Environment env, MemberDefinition f)
     Check if a field can reach another field (only considers forward references, not the access modifiers).
public  voidcheckBackBranch(Environment env, Statement loop, Vset vsEntry, Vset vsBack)
     Raise an error if a blank final was definitely unassigned on entry to a loop, but has possibly been assigned on the back-branch.
public  intdeclare(Environment env, LocalMember local)
    
public  intdeclareFieldNumber(MemberDefinition field)
     Assign a number to a class field.
public  ExpressionfindOuterLink(Environment env, long where, MemberDefinition f)
     Return a local expression which can serve as the base reference for the given field.
public  ExpressionfindOuterLink(Environment env, long where, ClassDefinition reqc, MemberDefinition f, boolean needExactMatch)
    
public  ClassDefinitionfindScope(Environment env, ClassDefinition reqc)
    
public  IdentifiergetApparentClassName(Environment env, Identifier name)
     Return the name of a lexically apparent type, skipping inherited members, and ignoring the current pacakge and imports.
final public  MemberDefinitiongetApparentField(Environment env, Identifier name)
     Like getField, except that it skips over inherited fields.
public  ContextgetBreakContext(Identifier lbl)
    
public  ContextgetContinueContext(Identifier lbl)
    
public  MemberDefinitiongetElement(int number)
     Return the local field or member field corresponding to a number.
final public  MemberDefinitiongetField(Environment env, Identifier name)
    
final public  MemberDefinitiongetField()
     Return the field containing the present context.
public  intgetFieldNumber(MemberDefinition field)
     Retrieve a number previously assigned by declareMember().
 ContextgetInlineContext()
    
 ContextgetInlineMemberContext(MemberDefinition field)
    
public  ContextgetLabelContext(Identifier lbl)
     Get the context that corresponds to a label, return null if not found.
public  LocalMembergetLocalClass(Identifier name)
    
public  LocalMembergetLocalField(Identifier name)
    
public  CheckContextgetReturnContext()
    
public  intgetScopeNumber(ClassDefinition c)
    
public  intgetThisNumber()
     Return the number of the innermost current instance reference.
public  CheckContextgetTryExitContext()
     Get the context of the innermost surrounding try-block. Consider only try-blocks contained within the same method. (There could be others when searching from within a method of a local class, but they are irrelevant to our purpose.) This is used for recording DA/DU information preceding all abnormal transfers of control: break, continue, return, and throw.
final public  intgetVarNumber()
    
public  booleanisInScope(LocalMember field)
     Check if the given field is active in this context.
public  ExpressionmakeReference(Environment env, LocalMember target)
     Implement a reference (usually an uplevel one).
public static  EnvironmentnewEnvironment(Environment env, Context ctx)
     Extend an environment with the given context.
public  UplevelReferencenoteReference(Environment env, LocalMember target)
     Notice a reference (usually an uplevel one).
public static  booleanouterLinkExists(Environment env, ClassDefinition reqc, ClassDefinition thisc)
    
final public  VsetremoveAdditionalVars(Vset vset)
     Remove variables from the vset set that are no longer part of this context.
 IdentifierresolveName(Environment env, Identifier name)
     Resolve a type name from within a local scope.

Field Detail
classes
LocalMember classes(Code)



field
MemberDefinition field(Code)



frameNumber
int frameNumber(Code)



locals
LocalMember locals(Code)



node
Node node(Code)



prev
Context prev(Code)



scopeNumber
int scopeNumber(Code)



varNumber
int varNumber(Code)




Constructor Detail
Context
public Context(Context ctx, MemberDefinition field)(Code)
Create the initial context for a method The incoming context is inherited from



Context
public Context(Context ctx, ClassDefinition c)(Code)
Create a new context, for initializing a class.



Context
Context(Context ctx, Node node)(Code)
Create a new nested context, for a block statement



Context
public Context(Context ctx)(Code)




Method Detail
canReach
public boolean canReach(Environment env, MemberDefinition f)(Code)
Check if a field can reach another field (only considers forward references, not the access modifiers).



checkBackBranch
public void checkBackBranch(Environment env, Statement loop, Vset vsEntry, Vset vsBack)(Code)
Raise an error if a blank final was definitely unassigned on entry to a loop, but has possibly been assigned on the back-branch. If this is the case, the loop may be assigning it multiple times.



declare
public int declare(Environment env, LocalMember local)(Code)
Declare local



declareFieldNumber
public int declareFieldNumber(MemberDefinition field)(Code)
Assign a number to a class field. (This is used to track definite assignment of some blank finals.)



findOuterLink
public Expression findOuterLink(Environment env, long where, MemberDefinition f)(Code)
Return a local expression which can serve as the base reference for the given field. If the field is a constructor, return an expression for the implicit enclosing instance argument.

Return null if there is no need for such an argument, or if there was an error.




findOuterLink
public Expression findOuterLink(Environment env, long where, ClassDefinition reqc, MemberDefinition f, boolean needExactMatch)(Code)



findScope
public ClassDefinition findScope(Environment env, ClassDefinition reqc)(Code)
From which enclosing class do members of this type come?



getApparentClassName
public Identifier getApparentClassName(Environment env, Identifier name)(Code)
Return the name of a lexically apparent type, skipping inherited members, and ignoring the current pacakge and imports. This is used for error checking.



getApparentField
final public MemberDefinition getApparentField(Environment env, Identifier name) throws AmbiguousMember, ClassNotFound(Code)
Like getField, except that it skips over inherited fields. Used for error checking.



getBreakContext
public Context getBreakContext(Identifier lbl)(Code)
Get the destination context of a break



getContinueContext
public Context getContinueContext(Identifier lbl)(Code)
Get the destination context of a continue



getElement
public MemberDefinition getElement(int number)(Code)
Return the local field or member field corresponding to a number. Return null if there is no such field.



getField
final public MemberDefinition getField(Environment env, Identifier name) throws AmbiguousMember, ClassNotFound(Code)
Get either a local variable, or a field in a current class



getField
final public MemberDefinition getField()(Code)
Return the field containing the present context.



getFieldNumber
public int getFieldNumber(MemberDefinition field)(Code)
Retrieve a number previously assigned by declareMember(). Return -1 if there was no such assignment in this context.



getInlineContext
Context getInlineContext()(Code)
Get the nearest inlined context



getInlineMemberContext
Context getInlineMemberContext(MemberDefinition field)(Code)
Get the context of a field that is being inlined



getLabelContext
public Context getLabelContext(Identifier lbl)(Code)
Get the context that corresponds to a label, return null if not found.



getLocalClass
public LocalMember getLocalClass(Identifier name)(Code)
Get a local class by name



getLocalField
public LocalMember getLocalField(Identifier name)(Code)
Get a local variable by name



getReturnContext
public CheckContext getReturnContext()(Code)
Get the destination context of a return (the method body)



getScopeNumber
public int getScopeNumber(ClassDefinition c)(Code)
Get the scope number for a reference to a member of this class (Larger scope numbers are more deeply nested.)
See Also:   LocalMember.scopeNumber



getThisNumber
public int getThisNumber()(Code)
Return the number of the innermost current instance reference.



getTryExitContext
public CheckContext getTryExitContext()(Code)
Get the context of the innermost surrounding try-block. Consider only try-blocks contained within the same method. (There could be others when searching from within a method of a local class, but they are irrelevant to our purpose.) This is used for recording DA/DU information preceding all abnormal transfers of control: break, continue, return, and throw.



getVarNumber
final public int getVarNumber()(Code)



isInScope
public boolean isInScope(LocalMember field)(Code)
Check if the given field is active in this context.



makeReference
public Expression makeReference(Environment env, LocalMember target)(Code)
Implement a reference (usually an uplevel one). Call noteReference() first, to make sure the reference lists are up to date.

The resulting expression tree does not need checking; it can be code-generated right away. If the reference is not uplevel, the result is an IDENT or THIS.




newEnvironment
public static Environment newEnvironment(Environment env, Context ctx)(Code)
Extend an environment with the given context. The resulting environment behaves the same as the given one, except that resolveName() takes into account local class names in this context.



noteReference
public UplevelReference noteReference(Environment env, LocalMember target)(Code)
Notice a reference (usually an uplevel one). Update the references list of every enclosing class which is enclosed by the scope of the target. Update decisions about which uplevels to make into fields. Return the uplevel reference descriptor, or null if it's local.

The target must be in scope in this context. So, call this method only from the check phase. (In other phases, the context may be less complete.)

This can and should be called both before and after classes are frozen. It should be a no-op, and will raise a compiler error if not.




outerLinkExists
public static boolean outerLinkExists(Environment env, ClassDefinition reqc, ClassDefinition thisc)(Code)
Is there a "this" of type reqc in scope?



removeAdditionalVars
final public Vset removeAdditionalVars(Vset vset)(Code)
Remove variables from the vset set that are no longer part of this context.



resolveName
Identifier resolveName(Environment env, Identifier name)(Code)
Resolve a type name from within a local scope.
See Also:   Environment.resolveName



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.