|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.javalanglevels.tree.JExpressionIFDepthFirstVisitor<TypeData>
edu.rice.cs.javalanglevels.TypeChecker
edu.rice.cs.javalanglevels.SpecialTypeChecker
edu.rice.cs.javalanglevels.ExpressionTypeChecker
public class ExpressionTypeChecker
This is a TypeChecker for all Expressions used in the students files. It is used with every LanguageLevel.
| Nested Class Summary | |
|---|---|
static class |
ExpressionTypeChecker.ExpressionTypeCheckerTest
Test class for the methods defined in the above (enclosing) class. |
| Nested classes/interfaces inherited from class edu.rice.cs.javalanglevels.SpecialTypeChecker |
|---|
SpecialTypeChecker.BobTest |
| Nested classes/interfaces inherited from class edu.rice.cs.javalanglevels.TypeChecker |
|---|
TypeChecker.TypeCheckerTest |
| Field Summary | |
|---|---|
static JavaVersion |
JAVA_VERSION
|
static NullLiteral |
NULL_LITERAL
|
| Fields inherited from class edu.rice.cs.javalanglevels.SpecialTypeChecker |
|---|
_data, _thrown, _vars, thingsThatHaveBeenAssigned |
| Fields inherited from class edu.rice.cs.javalanglevels.TypeChecker |
|---|
_abstractMav, _finalMav, _finalPublicMav, _log, _packageMav, _privateMav, _protectedMav, _publicAbstractMav, _publicMav, _publicStaticMav, NONE |
| Constructor Summary | |
|---|---|
ExpressionTypeChecker(Data data,
java.io.File file,
java.lang.String packageName,
java.util.LinkedList<java.lang.String> importedFiles,
java.util.LinkedList<java.lang.String> importedPackages,
java.util.LinkedList<VariableData> vars,
java.util.LinkedList<Pair<SymbolData,JExpression>> thrown)
Simply pass the necessary information on to superclass constructor. |
|
| Method Summary | |
|---|---|
protected SymbolData |
_getLeastRestrictiveType(SymbolData sd1,
SymbolData sd2)
Returns the least restrictive numerical type. |
protected boolean |
canBeAssigned(VariableData vd)
A variable data can be assigned to if it is not final or it does not have a value. |
InstanceData |
classInstantiationHelper(ClassInstantiation that,
SymbolData classToInstantiate)
Visit the ClassInstantiation's arguments. |
TypeData |
forArrayAccessOnly(ArrayAccess that,
TypeData lhs,
TypeData index)
Make sure the lhs is actually an array type and that the index is an int. |
TypeData |
forArrayInitializer(ArrayInitializer that)
The array initializer needs the type of the array to ensure it is properly handled. |
TypeData |
forBitwiseAssignmentExpressionOnly(BitwiseAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
Not currently supported. |
TypeData |
forBitwiseBinaryExpressionOnly(BitwiseBinaryExpression that,
TypeData left_result,
TypeData right_result)
Not currently supported. |
TypeData |
forBitwiseNotExpressionOnly(BitwiseNotExpression that,
TypeData valueRes)
Not Currently Supported. |
TypeData |
forBooleanExpressionOnly(BooleanExpression that,
TypeData left_result,
TypeData right_result)
Checks if this BooleanExpression is well-formed, i.e., that left and right arguments are well-formed boolean expressions. |
TypeData |
forBooleanLiteralOnly(BooleanLiteral that)
|
TypeData |
forBracedBody(BracedBody that)
Delegate to forBody |
TypeData |
forCastExpression(CastExpression that)
Try to look up the type of the cast, and visit the expression that is being cast. |
TypeData |
forCastExpressionOnly(CastExpression that,
TypeData typeRes,
TypeData valueRes)
Checks to see if this CastExpression is okay. |
TypeData |
forCharLiteralOnly(CharLiteral that)
|
TypeData |
forClassLiteralOnly(ClassLiteral that)
|
TypeData |
forComparisonExpressionOnly(ComparisonExpression that,
TypeData left_result,
TypeData right_result)
Verify that both the left and right of this comparison expression are number types and InstanceDatas. |
TypeData |
forComplexAnonymousClassInstantiation(ComplexAnonymousClassInstantiation that)
Resolve the type of this anonymous class. |
TypeData |
forComplexInitializedArrayInstantiation(ComplexInitializedArrayInstantiation that)
This is not legal java--should have been caught before the TypeChecker. |
TypeData |
forComplexMethodInvocation(ComplexMethodInvocation that)
Tries to match this method invocation to a method in the context. |
TypeData |
forComplexNamedClassInstantiation(ComplexNamedClassInstantiation that)
Handles this complex named class instantiation. |
TypeData |
forComplexNameReference(ComplexNameReference that)
To resolve this ComplexNameReference, first visit the lhs with an instance of this visitor in order to get its type. |
TypeData |
forComplexSuperReferenceOnly(ComplexSuperReference that,
TypeData enclosing_result)
Makes sure that the enclosing result is not null--if it is, return null. |
TypeData |
forComplexThisConstructorInvocation(ComplexThisConstructorInvocation that)
ComplexThisConstructorInvocations are not ever allowed. |
TypeData |
forComplexThisReferenceOnly(ComplexThisReference that,
TypeData enclosing_result)
Check to make sure that the enclosing result could be resolved and that it a type name. |
TypeData |
forComplexUninitializedArrayInstantiation(ComplexUninitializedArrayInstantiation that)
This is not legal java--should have been caught before the TypeChecker. |
TypeData |
forConditionalExpression(ConditionalExpression that)
Throw runtime exception, since conditional expressions are not allowed, and this should have been caught before the TypeChecker. |
TypeData |
forConditionalExpressionOnly(ConditionalExpression that,
TypeData condition_result,
TypeData forTrue_result,
TypeData forFalse_result)
Not currently supported |
TypeData |
forDivideAssignmentExpression(DivideAssignmentExpression that)
Delegate to method for super class. |
TypeData |
forDoubleLiteralOnly(DoubleLiteral that)
|
TypeData |
forEmptyExpressionOnly(EmptyExpression that)
Gives a Runtime Exception, because the fact that there is an EmptyExpression here should have been caught before the TypeChecker pass. |
TypeData |
forEmptyForCondition(EmptyForCondition that)
Process an instance of EmptyForCondition. |
TypeData |
forEqualityExpressionOnly(EqualityExpression that,
TypeData left_result,
TypeData right_result)
This EqualityExpression is badly formed if left_result and right_result have incompatible types. |
TypeData |
forFloatLiteralOnly(FloatLiteral that)
|
TypeData |
forIncrementExpression(IncrementExpression that)
Visit the value of this increment expression with the LValueWithValueTypeChecker, since whatever it represents should already have a value before we try to increment it. |
TypeData |
forIncrementExpressionOnly(IncrementExpression that,
TypeData valueRes)
An IncrementExpression is badly formatted if the thing being incremented is a type (valueRes is not an InstanceData) or if the value being incremented cannot be assigned to. |
TypeData |
forInnerClassDef(InnerClassDef that)
Look up the SymbolData for this InnerClass within the enclosing data, check for cyclic inheritance, and then visit everything inside the inner class. |
TypeData |
forInstanceofExpression(InstanceofExpression that)
Try to look up the type of the instanceof, and visit the expression that is being tested. |
TypeData |
forInstanceofExpressionOnly(InstanceofExpression that,
TypeData typeRes,
TypeData valueRes)
Checks to see if this InstanceofExpression is okay. |
TypeData |
forIntegerLiteralOnly(IntegerLiteral that)
|
TypeData |
forLongLiteralOnly(LongLiteral that)
|
TypeData |
forMinusAssignmentExpression(MinusAssignmentExpression that)
Delegate to method for super class. |
TypeData |
forModAssignmentExpression(ModAssignmentExpression that)
Delegate to method for super class. |
TypeData |
forMultiplyAssignmentExpression(MultiplyAssignmentExpression that)
Delegate to method for super class. |
TypeData |
forNegativePostfixIncrementExpression(NegativePostfixIncrementExpression that)
Process an instance of NegativePostfixIncrementExpression. |
TypeData |
forNegativePrefixIncrementExpression(NegativePrefixIncrementExpression that)
Process an instance of NegativePrefixIncrementExpression. |
TypeData |
forNoOpExpressionOnly(NoOpExpression that,
TypeData left_result,
TypeData right_result)
This should have been caught in the first pass. |
TypeData |
forNotExpressionOnly(NotExpression that,
TypeData valueRes)
A NotExpression is illformed if its argument is not an instance type or its argument is not of type boolean. |
TypeData |
forNullLiteralOnly(NullLiteral that)
|
TypeData |
forNumericAssignmentExpression(NumericAssignmentExpression that)
Visit the lhs of this assignment with the LValueWithValueTypeChecker, which does extra checking for the lhs, because it needs to be able to be assigned to and already have a value. |
TypeData |
forNumericAssignmentExpressionOnly(NumericAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
A NumericAssignmentExpression is okay if both the lhs and the rhs are instances, both are numbers, and the rhs is assignable to the lhs. |
TypeData |
forNumericBinaryExpressionOnly(NumericBinaryExpression that,
TypeData left_result,
TypeData right_result)
Check if this NumericBinaryExpression was okay. |
TypeData |
forNumericUnaryExpressionOnly(NumericUnaryExpression that,
TypeData valueRes)
A NumericUnaryExpression was well-formed if its valueRes is an instance type and if its valueRes's symbol data is a number type (to which a double can be assigned). |
TypeData |
forParenthesizedOnly(Parenthesized that,
TypeData valueRes)
Check a few constraints on this Parenthesized |
TypeData |
forPlusAssignmentExpression(PlusAssignmentExpression that)
Visit the lhs of this assignment with LValueWithValueTypeChecker, which does extra checking. |
TypeData |
forPlusAssignmentExpressionOnly(PlusAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
A PlusAssignmentExpression is okay if the lhs and rhs are both instances. |
TypeData |
forPlusExpressionOnly(PlusExpression that,
TypeData left_result,
TypeData right_result)
A plus operator can either be used on a string and any other type of object or on two numbers. |
TypeData |
forPositivePostfixIncrementExpression(PositivePostfixIncrementExpression that)
Process an instance of PositivePostfixIncrementExpression. |
TypeData |
forPositivePrefixIncrementExpression(PositivePrefixIncrementExpression that)
For these concrete instantiations of IncrementExpression, delegate to abstract method |
TypeData |
forShiftAssignmentExpressionOnly(ShiftAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
Not currently supported. |
TypeData |
forShiftBinaryExpressionOnly(ShiftBinaryExpression that,
TypeData left_result,
TypeData right_result)
Not currently supported |
TypeData |
forSimpleAnonymousClassInstantiation(SimpleAnonymousClassInstantiation that)
Resolve the type of this anonymous class. |
TypeData |
forSimpleAssignmentExpression(SimpleAssignmentExpression that)
Visit the lhs of this assignment with LValueTypeChecker, which does extra checking. |
TypeData |
forSimpleAssignmentExpressionOnly(SimpleAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
A SimpleAssignmentExpression is okay if both lhs and rhs are instances, and rhs is assignable to lhs. |
TypeData |
forSimpleInitializedArrayInstantiation(SimpleInitializedArrayInstantiation that)
Lookup the type of the array instantiation, and if there are any errors with it, give them. |
TypeData |
forSimpleMethodInvocation(SimpleMethodInvocation that)
Tries to match this method invocation to a method in the context. |
TypeData |
forSimpleNamedClassInstantiation(SimpleNamedClassInstantiation that)
Handles a simple class instantiation. |
TypeData |
forSimpleNameReference(SimpleNameReference that)
Try to resolve this SimpleNameReference. |
TypeData |
forSimpleSuperReference(SimpleSuperReference that)
All classes should have a super class, which is java.lang.Object by default. |
TypeData |
forSimpleThisConstructorInvocation(SimpleThisConstructorInvocation that)
SimpleThisConstructorInvocations are not allowed outside of the first line of a constructor. |
TypeData |
forSimpleThisReference(SimpleThisReference that)
Make sure we are in a non-static context. |
TypeData |
forSimpleUninitializedArrayInstantiation(SimpleUninitializedArrayInstantiation that)
Resolve the type of the array and visit its dimensions. |
TypeData |
forStringLiteralOnly(StringLiteral that)
|
TypeData |
forUninitializedArrayInstantiationOnly(UninitializedArrayInstantiation that,
TypeData typeRes,
TypeData[] dimensions_result)
Make sure the dimensions of the array instantiation are all instances and subtypes of int, and then return an instance of the array. |
SymbolData |
handleAnonymousClassInstantiation(AnonymousClassInstantiation that,
SymbolData superC)
Do the work that is shared between SimpleAnonymousClassInstantiation and ComplexAnonymousClassInstantiation. |
void |
handleUncheckedException(SymbolData sd,
JExpression j)
Throw the appropriate error, based on the type of the JExpression where the exception was unchecked |
boolean |
isCheckedException(SymbolData sd,
JExpression that)
Returns whether the sd is a checked exception, i.e. |
boolean |
isUncaughtCheckedException(SymbolData sd,
JExpression that)
Return true if the Exception is a checked exception yet is not caught or declared to be thrown, and false otherwise. |
TypeData |
methodInvocationHelper(MethodInvocation that,
TypeData context)
Look up the method called in the method invocation within the context of the context TypeData. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final JavaVersion JAVA_VERSION
public static final NullLiteral NULL_LITERAL
| Constructor Detail |
|---|
public ExpressionTypeChecker(Data data,
java.io.File file,
java.lang.String packageName,
java.util.LinkedList<java.lang.String> importedFiles,
java.util.LinkedList<java.lang.String> importedPackages,
java.util.LinkedList<VariableData> vars,
java.util.LinkedList<Pair<SymbolData,JExpression>> thrown)
data - The data that represents the context. TODO: What classes can it be?file - The file that corresponds to the source filepackageName - The string representing the package nameimportedFiles - The list of file names that have been specifically importedimportedPackages - The list of package names that have been specifically importedvars - The list of fields that have been assigned up to the point where SpecialTypeChecker is called.thrown - The list of exceptions that the context is declared to throw| Method Detail |
|---|
public TypeData forSimpleAssignmentExpression(SimpleAssignmentExpression that)
forSimpleAssignmentExpression in interface JExpressionIFVisitor<TypeData>forSimpleAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleAssignmentExpression to type check
public TypeData forSimpleAssignmentExpressionOnly(SimpleAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
forSimpleAssignmentExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleAssignmentExpression being typecheckednameRes - The TypeData representing the lhs of the assignmentvalueRes - The TypeData representing the rhs of the assignmentpublic TypeData forPlusAssignmentExpression(PlusAssignmentExpression that)
forPlusAssignmentExpression in interface JExpressionIFVisitor<TypeData>forPlusAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>that - The PlusAssignmentExpression to type check
public TypeData forPlusAssignmentExpressionOnly(PlusAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
forPlusAssignmentExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The PlusAssignmentExpression we are typecheckingnameRes - The TypeData representing the lhsvalueRes - The TypeData representing the rhs
public TypeData forNumericAssignmentExpression(NumericAssignmentExpression that)
that - The NumericAssignmentExpression to type check
public TypeData forMinusAssignmentExpression(MinusAssignmentExpression that)
forMinusAssignmentExpression in interface JExpressionIFVisitor<TypeData>forMinusAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forMultiplyAssignmentExpression(MultiplyAssignmentExpression that)
forMultiplyAssignmentExpression in interface JExpressionIFVisitor<TypeData>forMultiplyAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forDivideAssignmentExpression(DivideAssignmentExpression that)
forDivideAssignmentExpression in interface JExpressionIFVisitor<TypeData>forDivideAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forModAssignmentExpression(ModAssignmentExpression that)
forModAssignmentExpression in interface JExpressionIFVisitor<TypeData>forModAssignmentExpression in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forNumericAssignmentExpressionOnly(NumericAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
forNumericAssignmentExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleAssignmentExpression being typecheckednameRes - The TypeData representing the lhs of the assignmentvalueRes - The TypeData representing the rhs of the assignment
public TypeData forShiftAssignmentExpressionOnly(ShiftAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
forShiftAssignmentExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forBitwiseAssignmentExpressionOnly(BitwiseAssignmentExpression that,
TypeData nameRes,
TypeData valueRes)
forBitwiseAssignmentExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forBooleanExpressionOnly(BooleanExpression that,
TypeData left_result,
TypeData right_result)
forBooleanExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The BooleanExpression being checkedleft_result - The result from visiting the left side of the BooleanExpressionright_result - The result from visiting the right side of the BooleanExpression
public TypeData forBitwiseBinaryExpressionOnly(BitwiseBinaryExpression that,
TypeData left_result,
TypeData right_result)
forBitwiseBinaryExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forEqualityExpressionOnly(EqualityExpression that,
TypeData left_result,
TypeData right_result)
forEqualityExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The EqualityExpression being checkedleft_result - The result of visiting the left side of the expressionright_result - The result of visiting the right side of the expression
public TypeData forComparisonExpressionOnly(ComparisonExpression that,
TypeData left_result,
TypeData right_result)
forComparisonExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The Comparison expression being type-checkedleft_result - The result of visiting the left side of the expressionright_result - The result of visiting the right side of the expression
public TypeData forShiftBinaryExpressionOnly(ShiftBinaryExpression that,
TypeData left_result,
TypeData right_result)
forShiftBinaryExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forPlusExpressionOnly(PlusExpression that,
TypeData left_result,
TypeData right_result)
forPlusExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The PlusExpression being type-checked.left_result - The result of visiting the left side of this plus expressionright_result - The result of visiting the right side of this plus expression
public TypeData forNumericBinaryExpressionOnly(NumericBinaryExpression that,
TypeData left_result,
TypeData right_result)
forNumericBinaryExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The NumericBinaryExpression being checkedleft_result - The result from visiting the left side of the NumericBinaryExpressionright_result - The result from visiting the right side of the NumericBinaryExpression
public TypeData forNoOpExpressionOnly(NoOpExpression that,
TypeData left_result,
TypeData right_result)
forNoOpExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forIncrementExpression(IncrementExpression that)
public TypeData forPositivePrefixIncrementExpression(PositivePrefixIncrementExpression that)
forPositivePrefixIncrementExpression in interface JExpressionIFVisitor<TypeData>forPositivePrefixIncrementExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forNegativePrefixIncrementExpression(NegativePrefixIncrementExpression that)
JExpressionIFVisitor
forNegativePrefixIncrementExpression in interface JExpressionIFVisitor<TypeData>forNegativePrefixIncrementExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forPositivePostfixIncrementExpression(PositivePostfixIncrementExpression that)
JExpressionIFVisitor
forPositivePostfixIncrementExpression in interface JExpressionIFVisitor<TypeData>forPositivePostfixIncrementExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forNegativePostfixIncrementExpression(NegativePostfixIncrementExpression that)
JExpressionIFVisitor
forNegativePostfixIncrementExpression in interface JExpressionIFVisitor<TypeData>forNegativePostfixIncrementExpression in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forIncrementExpressionOnly(IncrementExpression that,
TypeData valueRes)
forIncrementExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The IncrementExpression that is being type checked.valueRes - The result of evaluating the argument to the increment expression.
public TypeData forNumericUnaryExpressionOnly(NumericUnaryExpression that,
TypeData valueRes)
forNumericUnaryExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The NumericUnaryExpression being evaluatedvalueRes - The result of evaluating the argument to this expression.
public TypeData forBitwiseNotExpressionOnly(BitwiseNotExpression that,
TypeData valueRes)
forBitwiseNotExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forNotExpressionOnly(NotExpression that,
TypeData valueRes)
forNotExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The NotExpression being type-checkedvalueRes - The type of the argument to the NotExpression
public TypeData forConditionalExpressionOnly(ConditionalExpression that,
TypeData condition_result,
TypeData forTrue_result,
TypeData forFalse_result)
forConditionalExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forInstanceofExpressionOnly(InstanceofExpression that,
TypeData typeRes,
TypeData valueRes)
forInstanceofExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The CastExpression being examined.typeRes - The type to be checkedvalueRes - The instance type of what is being checked
public TypeData forCastExpressionOnly(CastExpression that,
TypeData typeRes,
TypeData valueRes)
forCastExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The CastExpression being examined.typeRes - The type of the cast expressionvalueRes - The instance type of what is being cast
public TypeData forEmptyExpressionOnly(EmptyExpression that)
forEmptyExpressionOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public InstanceData classInstantiationHelper(ClassInstantiation that,
SymbolData classToInstantiate)
public TypeData forSimpleNamedClassInstantiation(SimpleNamedClassInstantiation that)
forSimpleNamedClassInstantiation in interface JExpressionIFVisitor<TypeData>forSimpleNamedClassInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forComplexNamedClassInstantiation(ComplexNamedClassInstantiation that)
forComplexNamedClassInstantiation in interface JExpressionIFVisitor<TypeData>forComplexNamedClassInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>that - The ComplexNamedClassInstantiation being created
public SymbolData handleAnonymousClassInstantiation(AnonymousClassInstantiation that,
SymbolData superC)
that - The AnonymousClassInstantiation being processed.superC - The SymbolData corresponding to the super class of this instantiation (the type being created)public TypeData forSimpleAnonymousClassInstantiation(SimpleAnonymousClassInstantiation that)
forSimpleAnonymousClassInstantiation in interface JExpressionIFVisitor<TypeData>forSimpleAnonymousClassInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleAnonymousClassInstantiation being type-checked
public TypeData forComplexAnonymousClassInstantiation(ComplexAnonymousClassInstantiation that)
forComplexAnonymousClassInstantiation in interface JExpressionIFVisitor<TypeData>forComplexAnonymousClassInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleAnonymousClassInstantiation being type-checked
public TypeData forSimpleThisConstructorInvocation(SimpleThisConstructorInvocation that)
forSimpleThisConstructorInvocation in interface JExpressionIFVisitor<TypeData>forSimpleThisConstructorInvocation in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forComplexThisConstructorInvocation(ComplexThisConstructorInvocation that)
forComplexThisConstructorInvocation in interface JExpressionIFVisitor<TypeData>forComplexThisConstructorInvocation in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forSimpleNameReference(SimpleNameReference that)
forSimpleNameReference in interface JExpressionIFVisitor<TypeData>forSimpleNameReference in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forComplexNameReference(ComplexNameReference that)
forComplexNameReference in interface JExpressionIFVisitor<TypeData>forComplexNameReference in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forSimpleThisReference(SimpleThisReference that)
forSimpleThisReference in interface JExpressionIFVisitor<TypeData>forSimpleThisReference in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData forComplexThisReferenceOnly(ComplexThisReference that,
TypeData enclosing_result)
forComplexThisReferenceOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The ComplexThisReference we are type-checkingenclosing_result - The TypeData whose this field is being referenced
public TypeData forSimpleSuperReference(SimpleSuperReference that)
forSimpleSuperReference in interface JExpressionIFVisitor<TypeData>forSimpleSuperReference in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleSuperReference we are resolving.
public TypeData forComplexSuperReferenceOnly(ComplexSuperReference that,
TypeData enclosing_result)
forComplexSuperReferenceOnly in class JExpressionIFDepthFirstVisitor<TypeData>that - The ComplexSuperReference being typecheckedenclosing_result - The type of the left hand side of this reference.
public TypeData forArrayAccessOnly(ArrayAccess that,
TypeData lhs,
TypeData index)
forArrayAccessOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forStringLiteralOnly(StringLiteral that)
forStringLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forIntegerLiteralOnly(IntegerLiteral that)
forIntegerLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forLongLiteralOnly(LongLiteral that)
forLongLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forFloatLiteralOnly(FloatLiteral that)
forFloatLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forDoubleLiteralOnly(DoubleLiteral that)
forDoubleLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forCharLiteralOnly(CharLiteral that)
forCharLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forBooleanLiteralOnly(BooleanLiteral that)
forBooleanLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forNullLiteralOnly(NullLiteral that)
forNullLiteralOnly in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forClassLiteralOnly(ClassLiteral that)
public TypeData forParenthesizedOnly(Parenthesized that,
TypeData valueRes)
forParenthesizedOnly in class JExpressionIFDepthFirstVisitor<TypeData>
public TypeData methodInvocationHelper(MethodInvocation that,
TypeData context)
that - The MethodInvocation we are type checkingcontext - The TypeData that should contain the method being invoked.public TypeData forSimpleMethodInvocation(SimpleMethodInvocation that)
forSimpleMethodInvocation in interface JExpressionIFVisitor<TypeData>forSimpleMethodInvocation in class JExpressionIFDepthFirstVisitor<TypeData>that - SimpleMethodInvocation we are typechecking
public TypeData forComplexMethodInvocation(ComplexMethodInvocation that)
forComplexMethodInvocation in interface JExpressionIFVisitor<TypeData>forComplexMethodInvocation in class JExpressionIFDepthFirstVisitor<TypeData>that - ComplexMethodInvocation we are typechecking
protected boolean canBeAssigned(VariableData vd)
canBeAssigned in class SpecialTypeCheckervd - The VariableData to check.
protected SymbolData _getLeastRestrictiveType(SymbolData sd1,
SymbolData sd2)
public TypeData forConditionalExpression(ConditionalExpression that)
forConditionalExpression in interface JExpressionIFVisitor<TypeData>forConditionalExpression in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forInstanceofExpression(InstanceofExpression that)
forInstanceofExpression in interface JExpressionIFVisitor<TypeData>forInstanceofExpression in class JExpressionIFDepthFirstVisitor<TypeData>that - The InstanceofExpression being typeChecked
public TypeData forCastExpression(CastExpression that)
forCastExpression in interface JExpressionIFVisitor<TypeData>forCastExpression in class TypeCheckerthat - The CastExpression being typeChecked
public TypeData forUninitializedArrayInstantiationOnly(UninitializedArrayInstantiation that,
TypeData typeRes,
TypeData[] dimensions_result)
that - The UninitializedArrayInstantiation being type checkedtypeRes - The type of the arraydimensions_result - The array of the result of type-checking all the dimensions of this array.
public TypeData forSimpleUninitializedArrayInstantiation(SimpleUninitializedArrayInstantiation that)
forSimpleUninitializedArrayInstantiation in interface JExpressionIFVisitor<TypeData>forSimpleUninitializedArrayInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleUninitializedArrayInstantiation being type-checked.
public TypeData forComplexUninitializedArrayInstantiation(ComplexUninitializedArrayInstantiation that)
forComplexUninitializedArrayInstantiation in interface JExpressionIFVisitor<TypeData>forComplexUninitializedArrayInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forArrayInitializer(ArrayInitializer that)
forArrayInitializer in interface JExpressionIFVisitor<TypeData>forArrayInitializer in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forSimpleInitializedArrayInstantiation(SimpleInitializedArrayInstantiation that)
forSimpleInitializedArrayInstantiation in interface JExpressionIFVisitor<TypeData>forSimpleInitializedArrayInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>that - The SimpleInitializedArrayAllocationInstantiation that is being type-checked
public TypeData forComplexInitializedArrayInstantiation(ComplexInitializedArrayInstantiation that)
forComplexInitializedArrayInstantiation in interface JExpressionIFVisitor<TypeData>forComplexInitializedArrayInstantiation in class JExpressionIFDepthFirstVisitor<TypeData>public TypeData forInnerClassDef(InnerClassDef that)
SpecialTypeChecker
forInnerClassDef in interface JExpressionIFVisitor<TypeData>forInnerClassDef in class SpecialTypeCheckerthat - The InnerClassDef we're visiting
public void handleUncheckedException(SymbolData sd,
JExpression j)
handleUncheckedException in class SpecialTypeCheckersd - The SymbolData corresponding to the exception that is thrownj - The JExpression corresponding to the context of where the exception is thrown from.
public boolean isCheckedException(SymbolData sd,
JExpression that)
isCheckedException in class SpecialTypeChecker
public boolean isUncaughtCheckedException(SymbolData sd,
JExpression that)
isUncaughtCheckedException in class SpecialTypeCheckersd - The SymbolData of the Exception we are checking.that - The JExpression passed to getSymbolData for error purposes.public TypeData forBracedBody(BracedBody that)
SpecialTypeChecker
forBracedBody in interface JExpressionIFVisitor<TypeData>forBracedBody in class SpecialTypeCheckerpublic TypeData forEmptyForCondition(EmptyForCondition that)
JExpressionIFVisitor
forEmptyForCondition in interface JExpressionIFVisitor<TypeData>forEmptyForCondition in class JExpressionIFDepthFirstVisitor<TypeData>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||