|
||||||||||
| 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.BodyTypeChecker
edu.rice.cs.javalanglevels.ConstructorBodyTypeChecker
public class ConstructorBodyTypeChecker
Do the TypeChecking appropriate to the context of a constructor body. Common to all Language Levels.
| Nested Class Summary | |
|---|---|
static class |
ConstructorBodyTypeChecker.ConstructorBodyTypeCheckerTest
Tests the methods in the above class. |
| Nested classes/interfaces inherited from class edu.rice.cs.javalanglevels.BodyTypeChecker |
|---|
BodyTypeChecker.BodyTypeCheckerTest |
| 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 |
|---|
| Fields inherited from class edu.rice.cs.javalanglevels.BodyTypeChecker |
|---|
_bodyData |
| 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, NULL_LITERAL |
| Constructor Summary | |
|---|---|
ConstructorBodyTypeChecker(BodyData bodyData,
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)
Constructor for ConstructorBodyTypeChecker. |
|
| Method Summary | |
|---|---|
TypeData |
complexSuperConstructorInvocationAllowed(ComplexSuperConstructorInvocation that)
This is used in the case where a complex super constructor invocation is allowed i.e. |
TypeData |
complexThisConstructorInvocationNotAllowed(ComplexThisConstructorInvocation that)
ComplexThisConstructorInvocations are not ever allowed--throw an appropriate error. |
protected BodyTypeChecker |
createANewInstanceOfMe(BodyData bodyData,
java.io.File file,
java.lang.String pakage,
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)
Creates a new instance of this class for visiting inner bodies. |
TypeData |
forBracedBody(BracedBody that)
Walk over the statements in the BracedBody, treating the first line specially. |
TypeData |
forValueReturnStatementOnly(ValueReturnStatement that,
TypeData valueRes)
Throw an error and return null, becuase constructors cannot have value return statements in their bodies. |
TypeData |
forVoidReturnStatementOnly(VoidReturnStatement that)
Void return statements are allowed in constructor bodies, since according to java, constructors are void return methods. |
TypeData |
simpleSuperConstructorInvocationAllowed(SimpleSuperConstructorInvocation that)
This is used in the case where a simple super constructor invocation is allowed i.e. |
TypeData |
simpleThisConstructorInvocationAllowed(SimpleThisConstructorInvocation that)
This is used in the case where a simple this constructor invocation is allowed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConstructorBodyTypeChecker(BodyData bodyData,
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)
bodyData - The bodyData corresponding to the constructor we are visitingfile - The File corresponding to the source file we are checking.packageName - The package of the source file.importedFiles - A list of the names of the classes that are specifically imported in the source fileimportedPackages - A list of the names of the packages that are imported in the source file.vars - A list of the variable datas that can be seen and have been given a value before this contextthrown - The exceptions that are thrown| Method Detail |
|---|
protected BodyTypeChecker createANewInstanceOfMe(BodyData bodyData,
java.io.File file,
java.lang.String pakage,
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)
createANewInstanceOfMe in class BodyTypeCheckerpublic TypeData simpleThisConstructorInvocationAllowed(SimpleThisConstructorInvocation that)
public TypeData complexThisConstructorInvocationNotAllowed(ComplexThisConstructorInvocation that)
public TypeData simpleSuperConstructorInvocationAllowed(SimpleSuperConstructorInvocation that)
public TypeData complexSuperConstructorInvocationAllowed(ComplexSuperConstructorInvocation that)
public TypeData forVoidReturnStatementOnly(VoidReturnStatement that)
forVoidReturnStatementOnly in class BodyTypeChecker
public TypeData forValueReturnStatementOnly(ValueReturnStatement that,
TypeData valueRes)
forValueReturnStatementOnly in class BodyTypeCheckerpublic TypeData forBracedBody(BracedBody that)
forBracedBody in interface JExpressionIFVisitor<TypeData>forBracedBody in class SpecialTypeChecker
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||