org.aspectj.org.eclipse.jdt.internal.core
Class CompilationUnitStructureRequestor

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter
      extended by org.aspectj.org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor
All Implemented Interfaces:
ISourceElementRequestor

public class CompilationUnitStructureRequestor
extends ReferenceInfoAdapter
implements ISourceElementRequestor

A requestor for the fuzzy parser, used to compute the children of an ICompilationUnit.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.ISourceElementRequestor
ISourceElementRequestor.FieldInfo, ISourceElementRequestor.MethodInfo, ISourceElementRequestor.TypeInfo, ISourceElementRequestor.TypeParameterInfo
 
Field Summary
protected  java.util.HashMap children
           
protected  HashtableOfObject fieldRefCache
           
protected  java.util.Stack handleStack
          Stack of parent handles, corresponding to the info stack.
protected  boolean hasSyntaxErrors
          Problem requestor which will get notified of discovered problems
protected  org.aspectj.org.eclipse.jdt.internal.core.JavaElementInfo importContainerInfo
          The import container info - null until created
protected  java.util.Stack infoStack
          Stack of parent scope info objects.
protected  HashtableOfObject messageRefCache
           
protected  java.util.Map newElements
          Hashtable of children elements of the compilation unit.
protected static byte[] NO_BYTES
          Empty collections used for efficient initialization
protected  Parser parser
           
protected  int referenceCount
          The number of references reported thus far.
protected  HashtableOfObject typeRefCache
           
protected  ICompilationUnit unit
          The handle to the compilation unit being parsed
protected  CompilationUnitElementInfo unitInfo
          The info object for the compilation unit being parsed
protected  HashtableOfObject unknownRefCache
           
 
Constructor Summary
protected CompilationUnitStructureRequestor(ICompilationUnit unit, CompilationUnitElementInfo unitInfo, java.util.Map newElements)
           
 
Method Summary
 void acceptImport(int declarationStart, int declarationEnd, char[][] tokens, boolean onDemand, int modifiers)
           
 void acceptLineSeparatorPositions(int[] positions)
           
 void acceptPackage(int declarationStart, int declarationEnd, char[] name)
           
 void acceptProblem(CategorizedProblem problem)
           
 void enterCompilationUnit()
           
 void enterConstructor(ISourceElementRequestor.MethodInfo methodInfo)
           
 void enterField(ISourceElementRequestor.FieldInfo fieldInfo)
           
 void enterInitializer(int declarationSourceStart, int modifiers)
           
 void enterMethod(ISourceElementRequestor.MethodInfo methodInfo)
           
 void enterType(ISourceElementRequestor.TypeInfo typeInfo)
           
protected  void enterTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo)
           
 void exitCompilationUnit(int declarationEnd)
           
 void exitConstructor(int declarationEnd)
           
 void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd)
           
 void exitInitializer(int declarationEnd)
           
protected  void exitMember(int declarationEnd)
          common processing for classes and interfaces
 void exitMethod(int declarationEnd, int defaultValueStart, int defaultValueEnd)
           
 void exitType(int declarationEnd)
           
protected  void resolveDuplicates(SourceRefElement handle)
          Resolves duplicate handles by incrementing the occurrence count of the handle being created until there is no conflict.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter
acceptConstructorReference, acceptFieldReference, acceptMethodReference, acceptTypeReference, acceptTypeReference, acceptUnknownReference, acceptUnknownReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.ISourceElementRequestor
acceptConstructorReference, acceptFieldReference, acceptMethodReference, acceptTypeReference, acceptTypeReference, acceptUnknownReference, acceptUnknownReference
 

Field Detail

unit

protected ICompilationUnit unit
The handle to the compilation unit being parsed


unitInfo

protected CompilationUnitElementInfo unitInfo
The info object for the compilation unit being parsed


importContainerInfo

protected org.aspectj.org.eclipse.jdt.internal.core.JavaElementInfo importContainerInfo
The import container info - null until created


newElements

protected java.util.Map newElements
Hashtable of children elements of the compilation unit. Children are added to the table as they are found by the parser. Keys are handles, values are corresponding info objects.


infoStack

protected java.util.Stack infoStack
Stack of parent scope info objects. The info on the top of the stack is the parent of the next element found. For example, when we locate a method, the parent info object will be the type the method is contained in.


children

protected java.util.HashMap children

handleStack

protected java.util.Stack handleStack
Stack of parent handles, corresponding to the info stack. We keep both, since info objects do not have back pointers to handles.


referenceCount

protected int referenceCount
The number of references reported thus far. Used to expand the arrays of reference kinds and names.


hasSyntaxErrors

protected boolean hasSyntaxErrors
Problem requestor which will get notified of discovered problems


parser

protected Parser parser

NO_BYTES

protected static byte[] NO_BYTES
Empty collections used for efficient initialization


fieldRefCache

protected HashtableOfObject fieldRefCache

messageRefCache

protected HashtableOfObject messageRefCache

typeRefCache

protected HashtableOfObject typeRefCache

unknownRefCache

protected HashtableOfObject unknownRefCache
Constructor Detail

CompilationUnitStructureRequestor

protected CompilationUnitStructureRequestor(ICompilationUnit unit,
                                            CompilationUnitElementInfo unitInfo,
                                            java.util.Map newElements)
Method Detail

acceptImport

public void acceptImport(int declarationStart,
                         int declarationEnd,
                         char[][] tokens,
                         boolean onDemand,
                         int modifiers)
Specified by:
acceptImport in interface ISourceElementRequestor
Parameters:
declarationStart - This is the position of the first character of the import keyword.
declarationEnd - This is the position of the ';' ending the import statement or the end of the comment following the import.
tokens - This are the tokens of the import like specified in the source.
onDemand - set to true if the import is an import on demand (e.g. import java.io.*). False otherwise.
modifiers - can be set to static from 1.5 on.
See Also:
ISourceElementRequestor

acceptLineSeparatorPositions

public void acceptLineSeparatorPositions(int[] positions)
Specified by:
acceptLineSeparatorPositions in interface ISourceElementRequestor

acceptPackage

public void acceptPackage(int declarationStart,
                          int declarationEnd,
                          char[] name)
Specified by:
acceptPackage in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

acceptProblem

public void acceptProblem(CategorizedProblem problem)
Specified by:
acceptProblem in interface ISourceElementRequestor

enterCompilationUnit

public void enterCompilationUnit()
Specified by:
enterCompilationUnit in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterConstructor

public void enterConstructor(ISourceElementRequestor.MethodInfo methodInfo)
Specified by:
enterConstructor in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterField

public void enterField(ISourceElementRequestor.FieldInfo fieldInfo)
Specified by:
enterField in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterInitializer

public void enterInitializer(int declarationSourceStart,
                             int modifiers)
Specified by:
enterInitializer in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterMethod

public void enterMethod(ISourceElementRequestor.MethodInfo methodInfo)
Specified by:
enterMethod in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterType

public void enterType(ISourceElementRequestor.TypeInfo typeInfo)
Specified by:
enterType in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterTypeParameter

protected void enterTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo)

exitCompilationUnit

public void exitCompilationUnit(int declarationEnd)
Specified by:
exitCompilationUnit in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitConstructor

public void exitConstructor(int declarationEnd)
Specified by:
exitConstructor in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitField

public void exitField(int initializationStart,
                      int declarationEnd,
                      int declarationSourceEnd)
Specified by:
exitField in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitInitializer

public void exitInitializer(int declarationEnd)
Specified by:
exitInitializer in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitMember

protected void exitMember(int declarationEnd)
common processing for classes and interfaces


exitMethod

public void exitMethod(int declarationEnd,
                       int defaultValueStart,
                       int defaultValueEnd)
Specified by:
exitMethod in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitType

public void exitType(int declarationEnd)
Specified by:
exitType in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

resolveDuplicates

protected void resolveDuplicates(SourceRefElement handle)
Resolves duplicate handles by incrementing the occurrence count of the handle being created until there is no conflict.