edu.rice.cs.javalanglevels
Class FullJavaVisitor
java.lang.Object
edu.rice.cs.javalanglevels.JExpressionIFPrunableDepthFirstVisitor
edu.rice.cs.javalanglevels.LanguageLevelVisitor
edu.rice.cs.javalanglevels.FullJavaVisitor
- All Implemented Interfaces:
- JExpressionIFVisitor<Void>
- Direct Known Subclasses:
- BodyBodyFullJavaVisitor, ClassBodyFullJavaVisitor, InterfaceBodyFullJavaVisitor
public class FullJavaVisitor
- extends LanguageLevelVisitor
Top-level Language Level Visitor that processes the Full Java Language Level. It constructs a symbol table from a
Java source file if possible. It does not attempt to check for errors since Full Java files are compiled by javac.
|
Constructor Summary |
FullJavaVisitor(File file)
This constructor is called when testing. |
FullJavaVisitor(File file,
LinkedList<Pair<String,JExpressionIF>> errors,
Hashtable<String,Pair<SourceInfo,LanguageLevelVisitor>> continuations,
LinkedList<Pair<LanguageLevelVisitor,SourceFile>> visitedFiles)
This constructor is called from LanguageLevelConverter when it is instantiating a new
FullJavaVisitor to visit a new file. |
FullJavaVisitor(File file,
String packageName,
LinkedList<String> importedFiles,
LinkedList<String> importedPackages,
LinkedList<String> classNamesInThisFile,
Hashtable<String,Pair<SourceInfo,LanguageLevelVisitor>> continuations)
This constructor is called from the subclasses of FullJavaVisitor when creating a new instance of FullJavaVisitor. |
|
Method Summary |
void |
anonymousClassInstantiationHelper(AnonymousClassInstantiation that,
Data enclosing,
SymbolData superC)
Do the work that is shared between SimpleAnonymousClassInstantiations and ComplexAnonymousClassInstantiations. |
void |
complexAnonymousClassInstantiationHelper(ComplexAnonymousClassInstantiation that,
Data data)
Do not resolve the super class type of this instantiation, because it will have already been resolved (it
is an inner class of the enclosing of this instantiation. |
void |
createConstructor(SymbolData sd)
At the FullJava Level, there is no code augmentation. |
protected void |
createEquals(SymbolData sd)
This is a noop, because we do not do code augmentation at the Advanced Level. |
protected void |
createHashCode(SymbolData sd)
This is a noop, because we do not do code augmentation at the Advanced Level. |
protected void |
createToString(SymbolData sd)
This is a noop, because we do not do code augmentation at the Advanced Level. |
Void |
forArrayType(ArrayType that)
Process an instance of ArrayType. |
Void |
forBracedBodyDoFirst(BracedBody that)
The top level should call forBracedBody which calls ... |
Void |
forClassDef(ClassDef that)
Use the doFirst method to make sure there aren't any errors with the declaration. |
Void |
forConditionalExpressionDoFirst(ConditionalExpression that)
Ignore ConditionalExpression. |
Void |
forInstanceInitializerDoFirst(InstanceInitializer that)
|
Void |
forInstanceofExpressionDoFirst(InstanceofExpression that)
Ignore instanceofExpression. |
Void |
forInterfaceDef(InterfaceDef that)
Create a SymbolData corresponding to this interface and add it appropriately. |
Void |
forLabeledBreakStatementDoFirst(LabeledBreakStatement that)
|
Void |
forLabeledContinueStatementDoFirst(LabeledContinueStatement that)
|
Void |
forLabeledStatementDoFirst(LabeledStatement that)
|
protected VariableData[] |
formalParameters2VariableData(FormalParameter[] fps,
Data d)
Convert the specified array of FormalParameters into an array of VariableDatas which is then returned. |
Void |
forModifiersAndVisibilityDoFirst(ModifiersAndVisibility that)
Process ModifiersAndVisibility. |
Void |
forPrimitiveTypeDoFirst(PrimitiveType that)
Process PrimitiveType. |
Void |
forStaticInitializerDoFirst(StaticInitializer that)
|
Void |
forSwitchStatementDoFirst(SwitchStatement that)
Process SwitchStatement. |
Void |
forSynchronizedStatementDoFirst(SynchronizedStatement that)
|
Void |
forTryCatchStatementDoFirst(TryCatchStatement that)
|
Void |
forTypeParameterDoFirst(TypeParameter that)
Ignore TypeParameter. |
protected void |
handleInnerClassDef(InnerClassDef that,
Data data,
String name)
Process the inner class def and then resolve it and store it in
the outer class's list of inner classes. |
protected void |
handleInnerInterfaceDef(InnerInterfaceDef that,
Data data,
String name)
Process the inner interface, and resolve it and store it in the
outer class's list of inner classes. |
void |
simpleAnonymousClassInstantiationHelper(SimpleAnonymousClassInstantiation that,
Data data)
Look up the super type of this class instantiation and add it to the symbol table. |
| Methods inherited from class edu.rice.cs.javalanglevels.LanguageLevelVisitor |
_addAndIgnoreError, _addError, _badModifiers, _checkError, _makeSourceInfo, _resetNonStaticFields, _variableDeclaration2VariableData, addGeneratedMethod, addInnerSymbolData, addSymbolData, arrayEquals, createAccessors, createMethodData, defineArraySymbolData, defineInnerSymbolData, defineSymbolData, forAbstractMethodDefDoFirst, forBitwiseAndExpressionDoFirst, forBitwiseAssignmentExpressionDoFirst, forBitwiseBinaryExpressionDoFirst, forBitwiseNotExpressionDoFirst, forBitwiseNotExpressionDoFirst, forBitwiseOrExpressionDoFirst, forBitwiseXorExpressionDoFirst, forClassDefDoFirst, forClassImportStatementOnly, forComplexNameReference, forConcreteMethodDefDoFirst, forEmptyExpressionDoFirst, forInnerInterfaceDefDoFirst, forInterfaceDefDoFirst, forMemberType, forNoOpExpressionDoFirst, forPackageImportStatementOnly, forPackageStatementOnly, forShiftAssignmentExpressionDoFirst, forShiftBinaryExpressionDoFirst, forSimpleNamedClassInstantiation, forSimpleNameReference, forSourceFile, forSourceFileDoFirst, forStringLiteralOnly, forVariableDeclaration, getFieldAccessorName, getFile, getQualifiedClassName, getSymbolData, getSymbolData, getSymbolData, getSymbolData, getSymbolData, getSymbolData, getSymbolDataForClassFile, getSymbolDataHelper, getUnqualifiedClassName, isConstructor, isDuplicateVariableData, isJavaLibraryClass, prune, referenceType2String |
| Methods inherited from class edu.rice.cs.javalanglevels.JExpressionIFPrunableDepthFirstVisitor |
defaultCase, defaultDoFirst, forAbstractMethodDef, forAbstractMethodDefOnly, forAndExpression, forAndExpressionDoFirst, forAndExpressionOnly, forAnonymousClassInstantiationDoFirst, forAnonymousClassInstantiationOnly, forArrayAccess, forArrayAccessDoFirst, forArrayAccessOnly, forArrayInitializer, forArrayInitializerDoFirst, forArrayInitializerOnly, forArrayInstantiationDoFirst, forArrayInstantiationOnly, forArrayTypeDoFirst, forArrayTypeOnly, forAssignmentExpressionDoFirst, forAssignmentExpressionOnly, forBinaryExpressionDoFirst, forBinaryExpressionOnly, forBitwiseAndAssignmentExpression, forBitwiseAndAssignmentExpressionDoFirst, forBitwiseAndAssignmentExpressionOnly, forBitwiseAndExpression, forBitwiseAndExpressionOnly, forBitwiseAssignmentExpressionOnly, forBitwiseBinaryExpressionOnly, forBitwiseNotExpression, forBitwiseNotExpressionOnly, forBitwiseOrAssignmentExpression, forBitwiseOrAssignmentExpressionDoFirst, forBitwiseOrAssignmentExpressionOnly, forBitwiseOrExpression, forBitwiseOrExpressionOnly, forBitwiseXorAssignmentExpression, forBitwiseXorAssignmentExpressionDoFirst, forBitwiseXorAssignmentExpressionOnly, forBitwiseXorExpression, forBitwiseXorExpressionOnly, forBlock, forBlockDoFirst, forBlockOnly, forBodyDoFirst, forBodyOnly, forBooleanExpressionDoFirst, forBooleanExpressionOnly, forBooleanLiteral, forBooleanLiteralDoFirst, forBooleanLiteralOnly, forBracedBody, forBracedBodyOnly, forBreakStatementDoFirst, forBreakStatementOnly, forCastExpression, forCastExpressionDoFirst, forCastExpressionOnly, forCatchBlock, forCatchBlockDoFirst, forCatchBlockOnly, forCharLiteral, forCharLiteralDoFirst, forCharLiteralOnly, forClassDefOnly, forClassImportStatement, forClassImportStatementDoFirst, forClassInstantiationDoFirst, forClassInstantiationOnly, forClassLiteral, forClassLiteralDoFirst, forClassLiteralOnly, forClassOrInterfaceType, forClassOrInterfaceTypeDoFirst, forClassOrInterfaceTypeOnly, forComparisonExpressionDoFirst, forComparisonExpressionOnly, forComplexAnonymousClassInstantiation, forComplexAnonymousClassInstantiationDoFirst, forComplexAnonymousClassInstantiationOnly, forComplexInitializedArrayInstantiation, forComplexInitializedArrayInstantiationDoFirst, forComplexInitializedArrayInstantiationOnly, forComplexMethodInvocation, forComplexMethodInvocationDoFirst, forComplexMethodInvocationOnly, forComplexNamedClassInstantiation, forComplexNamedClassInstantiationDoFirst, forComplexNamedClassInstantiationOnly, forComplexNameReferenceDoFirst, forComplexNameReferenceOnly, forComplexSuperConstructorInvocation, forComplexSuperConstructorInvocationDoFirst, forComplexSuperConstructorInvocationOnly, forComplexSuperReference, forComplexSuperReferenceDoFirst, forComplexSuperReferenceOnly, forComplexThisConstructorInvocation, forComplexThisConstructorInvocationDoFirst, forComplexThisConstructorInvocationOnly, forComplexThisReference, forComplexThisReferenceDoFirst, forComplexThisReferenceOnly, forComplexUninitializedArrayInstantiation, forComplexUninitializedArrayInstantiationDoFirst, forComplexUninitializedArrayInstantiationOnly, forCompoundWord, forCompoundWordDoFirst, forCompoundWordOnly, forConcreteMethodDef, forConcreteMethodDefOnly, forConditionalExpression, forConditionalExpressionOnly, forConstructorDef, forConstructorDefDoFirst, forConstructorDefOnly, forContinueStatementDoFirst, forContinueStatementOnly, forDefaultCase, forDefaultCaseDoFirst, forDefaultCaseOnly, forDimensionExpressionList, forDimensionExpressionListDoFirst, forDimensionExpressionListOnly, forDivideAssignmentExpression, forDivideAssignmentExpressionDoFirst, forDivideAssignmentExpressionOnly, forDivideExpression, forDivideExpressionDoFirst, forDivideExpressionOnly, forDoStatement, forDoStatementDoFirst, forDoStatementOnly, forDoubleLiteral, forDoubleLiteralDoFirst, forDoubleLiteralOnly, forEmptyExpression, forEmptyExpressionOnly, forEmptyForCondition, forEmptyForConditionDoFirst, forEmptyForConditionOnly, forEmptyStatement, forEmptyStatementDoFirst, forEmptyStatementOnly, forEqualityExpressionDoFirst, forEqualityExpressionOnly, forEqualsExpression, forEqualsExpressionDoFirst, forEqualsExpressionOnly, forExpressionDoFirst, forExpressionListDoFirst, forExpressionListOnly, forExpressionOnly, forExpressionStatement, forExpressionStatementDoFirst, forExpressionStatementOnly, forFloatLiteral, forFloatLiteralDoFirst, forFloatLiteralOnly, forFormalParameter, forFormalParameterDoFirst, forFormalParameterOnly, forForStatement, forForStatementDoFirst, forForStatementOnly, forFunctionInvocationDoFirst, forFunctionInvocationOnly, forGreaterThanExpression, forGreaterThanExpressionDoFirst, forGreaterThanExpressionOnly, forGreaterThanOrEqualExpression, forGreaterThanOrEqualExpressionDoFirst, forGreaterThanOrEqualExpressionOnly, forIfThenElseStatement, forIfThenElseStatementDoFirst, forIfThenElseStatementOnly, forIfThenStatement, forIfThenStatementDoFirst, forIfThenStatementOnly, forImportStatementDoFirst, forImportStatementOnly, forIncrementExpressionDoFirst, forIncrementExpressionOnly, forInitializedArrayInstantiationDoFirst, forInitializedArrayInstantiationOnly, forInitializedVariableDeclarator, forInitializedVariableDeclaratorDoFirst, forInitializedVariableDeclaratorOnly, forInitializerDoFirst, forInitializerOnly, forInnerClassDef, forInnerClassDefDoFirst, forInnerClassDefOnly, forInnerInterfaceDef, forInnerInterfaceDefOnly, forInstanceInitializer, forInstanceInitializerOnly, forInstanceofExpression, forInstanceofExpressionOnly, forInstantiationDoFirst, forInstantiationOnly, forIntegerLiteral, forIntegerLiteralDoFirst, forIntegerLiteralOnly, forInterfaceDefOnly, forJExpressionDoFirst, forJExpressionOnly, forLabeledBreakStatement, forLabeledBreakStatementOnly, forLabeledCase, forLabeledCaseDoFirst, forLabeledCaseOnly, forLabeledContinueStatement, forLabeledContinueStatementOnly, forLabeledStatement, forLabeledStatementOnly, forLeftShiftAssignmentExpression, forLeftShiftAssignmentExpressionDoFirst, forLeftShiftAssignmentExpressionOnly, forLeftShiftExpression, forLeftShiftExpressionDoFirst, forLeftShiftExpressionOnly, forLessThanExpression, forLessThanExpressionDoFirst, forLessThanExpressionOnly, forLessThanOrEqualExpression, forLessThanOrEqualExpressionDoFirst, forLessThanOrEqualExpressionOnly, forLexicalLiteralDoFirst, forLexicalLiteralOnly, forLongLiteral, forLongLiteralDoFirst, forLongLiteralOnly, forMemberTypeDoFirst, forMemberTypeOnly, forMethodDefDoFirst, forMethodDefOnly, forMethodInvocationDoFirst, forMethodInvocationOnly, forMinusAssignmentExpression, forMinusAssignmentExpressionDoFirst, forMinusAssignmentExpressionOnly, forMinusExpression, forMinusExpressionDoFirst, forMinusExpressionOnly, forModAssignmentExpression, forModAssignmentExpressionDoFirst, forModAssignmentExpressionOnly, forModExpression, forModExpressionDoFirst, forModExpressionOnly, forModifiersAndVisibility, forModifiersAndVisibilityOnly, forMultiplyAssignmentExpression, forMultiplyAssignmentExpressionDoFirst, forMultiplyAssignmentExpressionOnly, forMultiplyExpression, forMultiplyExpressionDoFirst, forMultiplyExpressionOnly, forNamedClassInstantiationDoFirst, forNamedClassInstantiationOnly, forNameReferenceDoFirst, forNameReferenceOnly, forNegativeExpression, forNegativeExpressionDoFirst, forNegativeExpressionOnly, forNegativePostfixIncrementExpression, forNegativePostfixIncrementExpressionDoFirst, forNegativePostfixIncrementExpressionOnly, forNegativePrefixIncrementExpression, forNegativePrefixIncrementExpressionDoFirst, forNegativePrefixIncrementExpressionOnly, forNoOpExpression, forNoOpExpressionOnly, forNormalTryCatchStatement, forNormalTryCatchStatementDoFirst, forNormalTryCatchStatementOnly, forNotEqualExpression, forNotEqualExpressionDoFirst, forNotEqualExpressionOnly, forNotExpression, forNotExpressionDoFirst, forNotExpressionOnly, forNullLiteral, forNullLiteralDoFirst, forNullLiteralOnly, forNumericAssignmentExpressionDoFirst, forNumericAssignmentExpressionOnly, forNumericBinaryExpressionDoFirst, forNumericBinaryExpressionOnly, forNumericUnaryExpressionDoFirst, forNumericUnaryExpressionOnly, forOrExpression, forOrExpressionDoFirst, forOrExpressionOnly, forPackageImportStatement, forPackageImportStatementDoFirst, forPackageStatement, forPackageStatementDoFirst, forParenthesized, forParenthesizedDoFirst, forParenthesizedExpressionList, forParenthesizedExpressionListDoFirst, forParenthesizedExpressionListOnly, forParenthesizedOnly, forPlusAssignmentExpression, forPlusAssignmentExpressionDoFirst, forPlusAssignmentExpressionOnly, forPlusExpression, forPlusExpressionDoFirst, forPlusExpressionOnly, forPositiveExpression, forPositiveExpressionDoFirst, forPositiveExpressionOnly, forPositivePostfixIncrementExpression, forPositivePostfixIncrementExpressionDoFirst, forPositivePostfixIncrementExpressionOnly, forPositivePrefixIncrementExpression, forPositivePrefixIncrementExpressionDoFirst, forPositivePrefixIncrementExpressionOnly, forPostfixIncrementExpressionDoFirst, forPostfixIncrementExpressionOnly, forPrefixIncrementExpressionDoFirst, forPrefixIncrementExpressionOnly, forPrimaryDoFirst, forPrimaryOnly, forPrimitiveType, forPrimitiveTypeOnly, forReferenceTypeDoFirst, forReferenceTypeOnly, forReturnStatementDoFirst, forReturnStatementOnly, forRightSignedShiftAssignmentExpression, forRightSignedShiftAssignmentExpressionDoFirst, forRightSignedShiftAssignmentExpressionOnly, forRightSignedShiftExpression, forRightSignedShiftExpressionDoFirst, forRightSignedShiftExpressionOnly, forRightUnsignedShiftAssignmentExpression, forRightUnsignedShiftAssignmentExpressionDoFirst, forRightUnsignedShiftAssignmentExpressionOnly, forRightUnsignedShiftExpression, forRightUnsignedShiftExpressionDoFirst, forRightUnsignedShiftExpressionOnly, forShiftAssignmentExpressionOnly, forShiftBinaryExpressionOnly, forSimpleAnonymousClassInstantiation, forSimpleAnonymousClassInstantiationDoFirst, forSimpleAnonymousClassInstantiationOnly, forSimpleAssignmentExpression, forSimpleAssignmentExpressionDoFirst, forSimpleAssignmentExpressionOnly, forSimpleInitializedArrayInstantiation, forSimpleInitializedArrayInstantiationDoFirst, forSimpleInitializedArrayInstantiationOnly, forSimpleMethodInvocation, forSimpleMethodInvocationDoFirst, forSimpleMethodInvocationOnly, forSimpleNamedClassInstantiationDoFirst, forSimpleNamedClassInstantiationOnly, forSimpleNameReferenceDoFirst, forSimpleNameReferenceOnly, forSimpleSuperConstructorInvocation, forSimpleSuperConstructorInvocationDoFirst, forSimpleSuperConstructorInvocationOnly, forSimpleSuperReference, forSimpleSuperReferenceDoFirst, forSimpleSuperReferenceOnly, forSimpleThisConstructorInvocation, forSimpleThisConstructorInvocationDoFirst, forSimpleThisConstructorInvocationOnly, forSimpleThisReference, forSimpleThisReferenceDoFirst, forSimpleThisReferenceOnly, forSimpleUninitializedArrayInstantiation, forSimpleUninitializedArrayInstantiationDoFirst, forSimpleUninitializedArrayInstantiationOnly, forSourceFileOnly, forStatementDoFirst, forStatementOnly, forStaticInitializer, forStaticInitializerOnly, forStringLiteral, forStringLiteralDoFirst, forSuperConstructorInvocationDoFirst, forSuperConstructorInvocationOnly, forSuperReferenceDoFirst, forSuperReferenceOnly, forSwitchCaseDoFirst, forSwitchCaseOnly, forSwitchStatement, forSwitchStatementOnly, forSynchronizedStatement, forSynchronizedStatementOnly, forThisConstructorInvocationDoFirst, forThisConstructorInvocationOnly, forThisReferenceDoFirst, forThisReferenceOnly, forThrowStatement, forThrowStatementDoFirst, forThrowStatementOnly, forTryCatchFinallyStatement, forTryCatchFinallyStatementDoFirst, forTryCatchFinallyStatementOnly, forTryCatchStatementOnly, forTypeDefBaseDoFirst, forTypeDefBaseOnly, forTypeDoFirst, forTypeOnly, forTypeParameter, forTypeParameterOnly, forTypeVariable, forTypeVariableDoFirst, forTypeVariableOnly, forUnaryExpressionDoFirst, forUnaryExpressionOnly, forUnbracedBody, forUnbracedBodyDoFirst, forUnbracedBodyOnly, forUninitializedArrayInstantiationDoFirst, forUninitializedArrayInstantiationOnly, forUninitializedVariableDeclarator, forUninitializedVariableDeclaratorDoFirst, forUninitializedVariableDeclaratorOnly, forUnlabeledBreakStatement, forUnlabeledBreakStatementDoFirst, forUnlabeledBreakStatementOnly, forUnlabeledContinueStatement, forUnlabeledContinueStatementDoFirst, forUnlabeledContinueStatementOnly, forUnparenthesizedExpressionList, forUnparenthesizedExpressionListDoFirst, forUnparenthesizedExpressionListOnly, forValueReturnStatement, forValueReturnStatementDoFirst, forValueReturnStatementOnly, forVariableDeclarationDoFirst, forVariableDeclarationOnly, forVariableDeclaratorDoFirst, forVariableDeclaratorOnly, forVariableReferenceDoFirst, forVariableReferenceOnly, forVoidReturn, forVoidReturnDoFirst, forVoidReturnOnly, forVoidReturnStatement, forVoidReturnStatementDoFirst, forVoidReturnStatementOnly, forWhileStatement, forWhileStatementDoFirst, forWhileStatementOnly, forWord, forWordDoFirst, forWordOnly |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FullJavaVisitor
public FullJavaVisitor(File file,
String packageName,
LinkedList<String> importedFiles,
LinkedList<String> importedPackages,
LinkedList<String> classNamesInThisFile,
Hashtable<String,Pair<SourceInfo,LanguageLevelVisitor>> continuations)
- This constructor is called from the subclasses of FullJavaVisitor when creating a new instance of FullJavaVisitor.
The default value for className is the empty string.
FullJavaVisitor
public FullJavaVisitor(File file)
- This constructor is called when testing. It initializes all of the static fields of LanguageLevelVisitor.
FullJavaVisitor
public FullJavaVisitor(File file,
LinkedList<Pair<String,JExpressionIF>> errors,
Hashtable<String,Pair<SourceInfo,LanguageLevelVisitor>> continuations,
LinkedList<Pair<LanguageLevelVisitor,SourceFile>> visitedFiles)
- This constructor is called from LanguageLevelConverter when it is instantiating a new
FullJavaVisitor to visit a new file. Package is set to "" by default.
- Parameters:
file - The File corresponding to the source file we are visitingerrors - The list of errors that have been encountered so far.continuations - The table of classes we have encountered but still need to resolvevisitedFiles - The list of files we have visited
createConstructor
public void createConstructor(SymbolData sd)
- At the FullJava Level, there is no code augmentation. If we are working with a class that has no constructor,
we must record fact that has an implicit 0-ary default constructor.
- Overrides:
createConstructor in class LanguageLevelVisitor
- Parameters:
sd - The SymbolData we are checking
handleInnerClassDef
protected void handleInnerClassDef(InnerClassDef that,
Data data,
String name)
- Process the inner class def and then resolve it and store it in
the outer class's list of inner classes. This method is common to both ClassBodyFullJavaVisitor
and InterfaceBodyIntermediateVisitor but needs the correct Data so we pass it in. This method is tested
in those files. We use the fully qualified name along with the $'s so we don't accidentally conflict with an
actual class in the symbol table.
- Parameters:
that - The AST Node for the inner class defdata - The Data that encloses this inner class. This is a Data because the inner class can be in a class
or a method.name - The qualified name of the inner class including the qualified name of the enclosing data followed by
a $. For local classes, we append a number after the $ corresponding to the order that the local
class appears in the enclosing class and then put the name of the class. For anonymous classes, we
only put a number after the $. For example, if class A has a method B that has a local class C, then
name should be "A$1C".
handleInnerInterfaceDef
protected void handleInnerInterfaceDef(InnerInterfaceDef that,
Data data,
String name)
- Process the inner interface, and resolve it and store it in the
outer class's list of inner classes. This method is common to both ClassBodyIntermediateVisitor
and InterfaceBodyIntermediateVisitor but needs the correct SymbolData so we pass it in. This method is tested
in those files.
forModifiersAndVisibilityDoFirst
public Void forModifiersAndVisibilityDoFirst(ModifiersAndVisibility that)
- Process ModifiersAndVisibility.
- Overrides:
forModifiersAndVisibilityDoFirst in class LanguageLevelVisitor
forSwitchStatementDoFirst
public Void forSwitchStatementDoFirst(SwitchStatement that)
- Process SwitchStatement.
- Overrides:
forSwitchStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forInstanceInitializerDoFirst
public Void forInstanceInitializerDoFirst(InstanceInitializer that)
- Overrides:
forInstanceInitializerDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forStaticInitializerDoFirst
public Void forStaticInitializerDoFirst(StaticInitializer that)
- Overrides:
forStaticInitializerDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forLabeledStatementDoFirst
public Void forLabeledStatementDoFirst(LabeledStatement that)
- Overrides:
forLabeledStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forLabeledBreakStatementDoFirst
public Void forLabeledBreakStatementDoFirst(LabeledBreakStatement that)
- Overrides:
forLabeledBreakStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forLabeledContinueStatementDoFirst
public Void forLabeledContinueStatementDoFirst(LabeledContinueStatement that)
- Overrides:
forLabeledContinueStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forSynchronizedStatementDoFirst
public Void forSynchronizedStatementDoFirst(SynchronizedStatement that)
- Overrides:
forSynchronizedStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forTypeParameterDoFirst
public Void forTypeParameterDoFirst(TypeParameter that)
- Ignore TypeParameter.
- Overrides:
forTypeParameterDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forConditionalExpressionDoFirst
public Void forConditionalExpressionDoFirst(ConditionalExpression that)
- Ignore ConditionalExpression.
- Overrides:
forConditionalExpressionDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forInstanceofExpressionDoFirst
public Void forInstanceofExpressionDoFirst(InstanceofExpression that)
- Ignore instanceofExpression.
- Overrides:
forInstanceofExpressionDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forPrimitiveTypeDoFirst
public Void forPrimitiveTypeDoFirst(PrimitiveType that)
- Process PrimitiveType.
- Overrides:
forPrimitiveTypeDoFirst in class JExpressionIFPrunableDepthFirstVisitor
forTryCatchStatementDoFirst
public Void forTryCatchStatementDoFirst(TryCatchStatement that)
- Overrides:
forTryCatchStatementDoFirst in class JExpressionIFPrunableDepthFirstVisitor
formalParameters2VariableData
protected VariableData[] formalParameters2VariableData(FormalParameter[] fps,
Data d)
- Convert the specified array of FormalParameters into an array of VariableDatas which is then returned. For each
parameter, try to resolve its type. A type can be a regular top level type, an inner class type, or something we
haven't seen yet (i.e., a continuation).
- Overrides:
formalParameters2VariableData in class LanguageLevelVisitor
- Parameters:
fps - The formal parameters we are trying to resolve.d - The data these formal parameters belong to.
- Returns:
- An array of VariableData corresponding to the formal parameters.
forClassDef
public Void forClassDef(ClassDef that)
- Use the doFirst method to make sure there aren't any errors with the declaration. Then, use defineSymbolData to
create the appropriate symbol data, and then visit the class body.
Once the ClassDef has been handled, remove the class from _classesToBeParsed so we know it's been taken care of.
- Specified by:
forClassDef in interface JExpressionIFVisitor<Void>- Overrides:
forClassDef in class JExpressionIFPrunableDepthFirstVisitor
- Parameters:
that - The ClassDef being handled.
TODO: refactor with same method in IntermediateVisitor; almost identical.
forBracedBodyDoFirst
public Void forBracedBodyDoFirst(BracedBody that)
- The top level should call forBracedBody which calls ...
- Overrides:
forBracedBodyDoFirst in class JExpressionIFPrunableDepthFirstVisitor
createToString
protected void createToString(SymbolData sd)
- This is a noop, because we do not do code augmentation at the Advanced Level.
- Overrides:
createToString in class LanguageLevelVisitor
createHashCode
protected void createHashCode(SymbolData sd)
- This is a noop, because we do not do code augmentation at the Advanced Level.
- Overrides:
createHashCode in class LanguageLevelVisitor
createEquals
protected void createEquals(SymbolData sd)
- This is a noop, because we do not do code augmentation at the Advanced Level.
- Overrides:
createEquals in class LanguageLevelVisitor
forInterfaceDef
public Void forInterfaceDef(InterfaceDef that)
- Create a SymbolData corresponding to this interface and add it appropriately.
Then visit the body to handle anything defined inside the interface.
Once the interface has been resolved, remove it from _classesToBeParsed.
TODO: refactor with same method in IntermediateVisitor; they appear identical
- Specified by:
forInterfaceDef in interface JExpressionIFVisitor<Void>- Overrides:
forInterfaceDef in class JExpressionIFPrunableDepthFirstVisitor
anonymousClassInstantiationHelper
public void anonymousClassInstantiationHelper(AnonymousClassInstantiation that,
Data enclosing,
SymbolData superC)
- Do the work that is shared between SimpleAnonymousClassInstantiations and ComplexAnonymousClassInstantiations.
Do not generate automatic accessors for the anonymous class--this will be done in type checker pass.
- Parameters:
that - The AnonymousClassInstantiation being visitedenclosing - The enclosing DatasuperC - The super class being instantiated--i.e. new A() { ...}, would have a super class of A.
simpleAnonymousClassInstantiationHelper
public void simpleAnonymousClassInstantiationHelper(SimpleAnonymousClassInstantiation that,
Data data)
- Look up the super type of this class instantiation and add it to the symbol table. Visit the body of the class
instantiation. All handling of this as an anonymous inner class (i.e. adding it to the enclosing SD's list of
inner classes, creating a symbol data for the anonyomous inner class, etc) is handled in the TypeChecker pass.
This is because no one will depend on that symbolData until we create it.
- Parameters:
that - The SimpleAnonymousClassInstantiation being processed.
complexAnonymousClassInstantiationHelper
public void complexAnonymousClassInstantiationHelper(ComplexAnonymousClassInstantiation that,
Data data)
- Do not resolve the super class type of this instantiation, because it will have already been resolved (it
is an inner class of the enclosing of this instantiation. When the enclosing was resolved, all of its inner
classes should have also been resolved).
Visit the body of the class instantiation.
- Parameters:
that - The ComplexAnonymousClassInstantiation being processed.data - The enclosing data where this was sreferenced from.
forArrayType
public Void forArrayType(ArrayType that)
- Description copied from interface:
JExpressionIFVisitor
- Process an instance of ArrayType.
- Specified by:
forArrayType in interface JExpressionIFVisitor<Void>- Overrides:
forArrayType in class JExpressionIFPrunableDepthFirstVisitor