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


java.lang.Object
   com.sun.tools.javac.tree.JCTree
      com.sun.tools.javac.comp.Enter

Enter
public class Enter extends JCTree.Visitor (Code)
This class enters symbols for all encountered definitions into the symbol table. The pass consists of two phases, organized as follows:

In the first phase, all class symbols are intered into their enclosing scope, descending recursively down the tree for classes which are members of other classes. The class symbols are given a MemberEnter object as completer.

In the second phase classes are completed using MemberEnter.complete(). Completion might occur on demand, but any classes that are not completed that way will be eventually completed by processing the `uncompleted' queue. Completion entails (1) determination of a class's parameters, supertype and interfaces, as well as (2) entering all symbols defined in the class into its scope, with the exception of class symbols which have been entered in phase 1. (2) depends on (1) having been completed for a class and all its superclasses and enclosing classes. That's why, after doing (1), we put classes in a `halfcompleted' queue. Only when we have performed (1) for a class and all it's superclasses and enclosing classes, we proceed to (2).

Whereas the first phase is organized as a sweep through all compiled syntax trees, the second phase is demand. Members of a class are entered when the contents of a class are first accessed. This is accomplished by installing completer objects in class symbols for compiled classes which invoke the member-enter phase for the corresponding class tree.

Classes migrate from one phase to the next via queues:

 class enter -> (Enter.uncompleted)         --> member enter (1)
 -> (MemberEnter.halfcompleted) --> member enter (2)
 -> (Todo)	               --> attribute
 (only for toplevel classes)
 

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.



Field Summary
 Annotateannotate
    
 Checkchk
    
final protected static  Context.Key<Enter>enterKey
    
protected  Env<AttrContext>env
     Visitor argument: the current environment.
 JavaFileManagerfileManager
    
 Lintlint
    
 Loglog
    
 TreeMakermake
    
 MemberEntermemberEnter
    
 ClassReaderreader
    
 Typeresult
     Visitor result: the computed type.
 Symtabsyms
    
 Map<TypeSymbol, Env<AttrContext>>typeEnvs
     A hashtable mapping classes and packages to the environments current at the points of their definitions.
 ListBuffer<ClassSymbol>uncompleted
     The queue of all classes that might still need to be completed; saved and initialized by main().

Constructor Summary
protected  Enter(Context context)
    

Method Summary
 TypeclassEnter(JCTree tree, Env<AttrContext> env)
     Visitor method: enter all classes in given tree, catching any completion failure exceptions.
 List<Type>classEnter(List<T> trees, Env<AttrContext> env)
     Visitor method: enter classes of a list of trees, returning a list of types.
public  Env<AttrContext>classEnv(JCClassDecl tree, Env<AttrContext> env)
     Create a fresh environment for class bodies.
public  voidcomplete(List<JCCompilationUnit> trees, ClassSymbol c)
     Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
protected  voidduplicateClass(DiagnosticPosition pos, ClassSymbol c)
     Complain about a duplicate class.
 ScopeenterScope(Env<AttrContext> env)
     The scope in which a member definition in environment env is to be entered This is usually the environment's scope, except for class environments, where the local scope is for type variables, and the this and super symbol only, and members go into the class member scope.
public  Env<AttrContext>getClassEnv(TypeSymbol sym)
    
public  Env<AttrContext>getEnv(TypeSymbol sym)
    
public  Env<AttrContext>getTopLevelEnv(JCCompilationUnit tree)
    
public static  Enterinstance(Context context)
    
public  voidmain(List<JCCompilationUnit> trees)
     Main method: enter all classes in a list of toplevel trees.
 Env<AttrContext>topLevelEnv(JCCompilationUnit tree)
     Create a fresh environment for toplevels.
public  voidvisitClassDef(JCClassDecl tree)
    
public  voidvisitTopLevel(JCCompilationUnit tree)
    
public  voidvisitTree(JCTree tree)
     Default class enter visitor method: do nothing.
public  voidvisitTypeParameter(JCTypeParameter tree)
     Class enter visitor method for type parameters.

Field Detail
annotate
Annotate annotate(Code)



chk
Check chk(Code)



enterKey
final protected static Context.Key<Enter> enterKey(Code)



env
protected Env<AttrContext> env(Code)
Visitor argument: the current environment.



fileManager
JavaFileManager fileManager(Code)



lint
Lint lint(Code)



log
Log log(Code)



make
TreeMaker make(Code)



memberEnter
MemberEnter memberEnter(Code)



reader
ClassReader reader(Code)



result
Type result(Code)
Visitor result: the computed type.



syms
Symtab syms(Code)



typeEnvs
Map<TypeSymbol, Env<AttrContext>> typeEnvs(Code)
A hashtable mapping classes and packages to the environments current at the points of their definitions.



uncompleted
ListBuffer<ClassSymbol> uncompleted(Code)
The queue of all classes that might still need to be completed; saved and initialized by main().




Constructor Detail
Enter
protected Enter(Context context)(Code)




Method Detail
classEnter
Type classEnter(JCTree tree, Env<AttrContext> env)(Code)
Visitor method: enter all classes in given tree, catching any completion failure exceptions. Return the tree's type.
Parameters:
  tree - The tree to be visited.
Parameters:
  env - The environment visitor argument.



classEnter
List<Type> classEnter(List<T> trees, Env<AttrContext> env)(Code)
Visitor method: enter classes of a list of trees, returning a list of types.



classEnv
public Env<AttrContext> classEnv(JCClassDecl tree, Env<AttrContext> env)(Code)
Create a fresh environment for class bodies. This will create a fresh scope for local symbols of a class, referred to by the environments info.scope field. This scope will contain - symbols for this and super - symbols for any type parameters In addition, it serves as an anchor for scopes of methods and initializers which are nested in this scope via Scope.dup(). This scope should not be confused with the members scope of a class.
Parameters:
  tree - The class definition.
Parameters:
  env - The environment current outside of the class definition.



complete
public void complete(List<JCCompilationUnit> trees, ClassSymbol c)(Code)
Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
Parameters:
  trees - The list of trees to be processed.
Parameters:
  c - The class symbol to be processed.



duplicateClass
protected void duplicateClass(DiagnosticPosition pos, ClassSymbol c)(Code)
Complain about a duplicate class.



enterScope
Scope enterScope(Env<AttrContext> env)(Code)
The scope in which a member definition in environment env is to be entered This is usually the environment's scope, except for class environments, where the local scope is for type variables, and the this and super symbol only, and members go into the class member scope.



getClassEnv
public Env<AttrContext> getClassEnv(TypeSymbol sym)(Code)



getEnv
public Env<AttrContext> getEnv(TypeSymbol sym)(Code)
Accessor for typeEnvs



getTopLevelEnv
public Env<AttrContext> getTopLevelEnv(JCCompilationUnit tree)(Code)



instance
public static Enter instance(Context context)(Code)



main
public void main(List<JCCompilationUnit> trees)(Code)
Main method: enter all classes in a list of toplevel trees.
Parameters:
  trees - The list of trees to be processed.



topLevelEnv
Env<AttrContext> topLevelEnv(JCCompilationUnit tree)(Code)
Create a fresh environment for toplevels.
Parameters:
  tree - The toplevel tree.



visitClassDef
public void visitClassDef(JCClassDecl tree)(Code)



visitTopLevel
public void visitTopLevel(JCCompilationUnit tree)(Code)



visitTree
public void visitTree(JCTree tree)(Code)
Default class enter visitor method: do nothing.



visitTypeParameter
public void visitTypeParameter(JCTypeParameter tree)(Code)
Class enter visitor method for type parameters. Enter a symbol for type parameter in local scope, after checking that it is unique.



Fields inherited from com.sun.tools.javac.tree.JCTree
final public static int AND(Code)(Java Doc)
final public static int ANNOTATION(Code)(Java Doc)
final public static int APPLY(Code)(Java Doc)
final public static int ASGOffset(Code)(Java Doc)
final public static int ASSERT(Code)(Java Doc)
final public static int ASSIGN(Code)(Java Doc)
final public static int BITAND(Code)(Java Doc)
final public static int BITAND_ASG(Code)(Java Doc)
final public static int BITOR(Code)(Java Doc)
final public static int BITOR_ASG(Code)(Java Doc)
final public static int BITXOR(Code)(Java Doc)
final public static int BITXOR_ASG(Code)(Java Doc)
final public static int BLOCK(Code)(Java Doc)
final public static int BREAK(Code)(Java Doc)
final public static int CASE(Code)(Java Doc)
final public static int CATCH(Code)(Java Doc)
final public static int CLASSDEF(Code)(Java Doc)
final public static int COMPL(Code)(Java Doc)
final public static int CONDEXPR(Code)(Java Doc)
final public static int CONTINUE(Code)(Java Doc)
final public static int DIV(Code)(Java Doc)
final public static int DIV_ASG(Code)(Java Doc)
final public static int DOLOOP(Code)(Java Doc)
final public static int EQ(Code)(Java Doc)
final public static int ERRONEOUS(Code)(Java Doc)
final public static int EXEC(Code)(Java Doc)
final public static int FOREACHLOOP(Code)(Java Doc)
final public static int FORLOOP(Code)(Java Doc)
final public static int GE(Code)(Java Doc)
final public static int GT(Code)(Java Doc)
final public static int IDENT(Code)(Java Doc)
final public static int IF(Code)(Java Doc)
final public static int IMPORT(Code)(Java Doc)
final public static int INDEXED(Code)(Java Doc)
final public static int LABELLED(Code)(Java Doc)
final public static int LE(Code)(Java Doc)
final public static int LETEXPR(Code)(Java Doc)
final public static int LITERAL(Code)(Java Doc)
final public static int LT(Code)(Java Doc)
final public static int METHODDEF(Code)(Java Doc)
final public static int MINUS(Code)(Java Doc)
final public static int MINUS_ASG(Code)(Java Doc)
final public static int MOD(Code)(Java Doc)
final public static int MODIFIERS(Code)(Java Doc)
final public static int MOD_ASG(Code)(Java Doc)
final public static int MUL(Code)(Java Doc)
final public static int MUL_ASG(Code)(Java Doc)
final public static int NE(Code)(Java Doc)
final public static int NEG(Code)(Java Doc)
final public static int NEWARRAY(Code)(Java Doc)
final public static int NEWCLASS(Code)(Java Doc)
final public static int NOT(Code)(Java Doc)
final public static int NULLCHK(Code)(Java Doc)
final public static int OR(Code)(Java Doc)
final public static int PARENS(Code)(Java Doc)
final public static int PLUS(Code)(Java Doc)
final public static int PLUS_ASG(Code)(Java Doc)
final public static int POS(Code)(Java Doc)
final public static int POSTDEC(Code)(Java Doc)
final public static int POSTINC(Code)(Java Doc)
final public static int PREDEC(Code)(Java Doc)
final public static int PREINC(Code)(Java Doc)
final public static int RETURN(Code)(Java Doc)
final public static int SELECT(Code)(Java Doc)
final public static int SKIP(Code)(Java Doc)
final public static int SL(Code)(Java Doc)
final public static int SL_ASG(Code)(Java Doc)
final public static int SR(Code)(Java Doc)
final public static int SR_ASG(Code)(Java Doc)
final public static int SWITCH(Code)(Java Doc)
final public static int SYNCHRONIZED(Code)(Java Doc)
final public static int THROW(Code)(Java Doc)
final public static int TOPLEVEL(Code)(Java Doc)
final public static int TRY(Code)(Java Doc)
final public static int TYPEAPPLY(Code)(Java Doc)
final public static int TYPEARRAY(Code)(Java Doc)
final public static int TYPEBOUNDKIND(Code)(Java Doc)
final public static int TYPECAST(Code)(Java Doc)
final public static int TYPEIDENT(Code)(Java Doc)
final public static int TYPEPARAMETER(Code)(Java Doc)
final public static int TYPETEST(Code)(Java Doc)
final public static int USR(Code)(Java Doc)
final public static int USR_ASG(Code)(Java Doc)
final public static int VARDEF(Code)(Java Doc)
final public static int WHILELOOP(Code)(Java Doc)
final public static int WILDCARD(Code)(Java Doc)
public int pos(Code)(Java Doc)
public Type type(Code)(Java Doc)

Methods inherited from com.sun.tools.javac.tree.JCTree
abstract public void accept(Visitor v)(Code)(Java Doc)
abstract public R accept(TreeVisitor<R, D> v, D d)(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int getEndPosition(Map<JCTree, Integer> endPosTable)(Code)(Java Doc)
public int getPreferredPosition()(Code)(Java Doc)
public int getStartPosition()(Code)(Java Doc)
abstract public int getTag()(Code)(Java Doc)
public JCTree getTree()(Code)(Java Doc)
public DiagnosticPosition pos()(Code)(Java Doc)
public JCTree setPos(int pos)(Code)(Java Doc)
public JCTree setType(Type type)(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.