|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.tc.FlowInsensitiveChecks
Does disambiguation and flow insensitive checks on a type declaration.
Field Summary | |
protected TypeSigVec |
allowedExceptions
|
private static ASTDecoration |
branchDecoration
Decorates BranchStmt nodes to point to labelled Stmt
objects. |
static boolean |
dontAddImplicitConstructorInvocations
Controls whether or not implicit super-calls in constructors are made explicit. |
protected StmtVec |
enclosingLabels
|
static FlowInsensitiveChecks |
inst
|
protected boolean |
leftToRight
|
protected Type |
returnType
|
protected EnvForTypeSig |
rootIEnv
|
protected EnvForTypeSig |
rootSEnv
|
protected TypeSig |
sig
|
private static ASTDecoration |
typeDecoration
Decorates VarInit nodes to point to Type objects. |
Constructor Summary | |
protected |
FlowInsensitiveChecks()
|
Method Summary | |
protected boolean |
assignmentConvertable(Expr e,
Type t)
Checks if Exp e can be assigned to Type t. |
protected Type |
checkBinaryExpr(int op,
Expr left,
Expr right,
int loc)
|
protected Expr |
checkDesignator(Env env,
Expr e)
|
protected Expr |
checkExpr(Env env,
Expr x)
This method should call setType on x before its
done. |
protected Expr |
checkExpr(Env env,
Expr expr,
Type t)
|
protected Type[] |
checkExprVec(Env env,
ExprVec ev)
|
void |
checkFieldDecl(FieldDecl fd)
Moves fd into implementation checked state. |
protected void |
checkForLoopAfterInit(Env se,
ForStmt f)
|
protected VarInit |
checkInit(Env env,
VarInit x,
Type expectedResult)
|
(package private) static boolean |
checkIntegralType(Expr e)
|
protected Env |
checkModifierPragma(ModifierPragma p,
ASTNode ctxt,
Env env)
Hook to do additional processing on Modifier s. |
protected Env |
checkModifierPragmaVec(ModifierPragmaVec v,
ASTNode ctxt,
Env env)
Hook to do additional processing on ModifierVec s. |
(package private) static boolean |
checkNumericType(Expr e)
|
protected Type |
checkObjectDesignator(Env env,
ObjectDesignator od)
|
protected Env |
checkStmt(Env e,
Stmt s)
Typecheck a statement in a given environment then return the environment in effect for statements that follow the given statement. |
protected Env |
checkStmtPragma(Env e,
StmtPragma s)
|
protected Env |
checkStmtVec(Env env,
StmtVec v)
|
(package private) static void |
checkType(Expr expr,
Type t)
|
void |
checkTypeDeclaration(TypeSig s)
Moves s into implementation checked state. |
protected void |
checkTypeDeclElem(TypeDeclElem e)
|
protected void |
checkTypeDeclElemPragma(TypeDeclElemPragma e)
|
protected Env |
checkTypeModifierPragma(TypeModifierPragma p,
ASTNode ctxt,
Env env)
|
protected Env |
checkTypeModifierPragmaVec(TypeModifierPragmaVec v,
ASTNode ctxt,
Env env)
|
protected Env |
checkTypeModifiers(Env env,
Type t)
This may be called more than once on a Type t. |
(package private) static Stmt |
getBranchLabel(BranchStmt s)
Retrieves the Stmt target of a BranchStmt . |
static Type |
getType(VarInit i)
Retrieves the Type of a VarInit . |
protected static Type |
getTypeOrNull(VarInit i)
Retrieves the Type of a VarInit . |
static FlowInsensitiveChecks |
inst()
|
(package private) static boolean |
isVariable(Expr e)
|
protected EnvForTypeSig |
makeEnvForTypeSig(TypeSig s,
boolean staticContext)
Factory method so subclasses can override. |
protected static void |
reportLookupException(LookupException e,
java.lang.String s,
java.lang.String t,
int loc)
|
private static void |
setBranchLabel(BranchStmt s,
Stmt l)
|
static VarInit |
setType(VarInit i,
Type t)
|
private Type |
tryCondExprMatch(Expr leftExpr,
Expr rightExpr)
Return the type of a E1 : L ? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static FlowInsensitiveChecks inst
public static boolean dontAddImplicitConstructorInvocations
protected TypeSig sig
protected EnvForTypeSig rootIEnv
protected EnvForTypeSig rootSEnv
protected boolean leftToRight
protected Type returnType
protected TypeSigVec allowedExceptions
protected StmtVec enclosingLabels
private static ASTDecoration typeDecoration
VarInit
nodes to point to Type
objects.
private static ASTDecoration branchDecoration
BranchStmt
nodes to point to labelled Stmt
objects.
Constructor Detail |
protected FlowInsensitiveChecks()
Method Detail |
public static FlowInsensitiveChecks inst()
protected EnvForTypeSig makeEnvForTypeSig(TypeSig s, boolean staticContext)
public void checkTypeDeclaration(TypeSig s)
s
into implementation checked state.
public void checkFieldDecl(FieldDecl fd)
fd
into implementation checked state.
protected void checkTypeDeclElem(TypeDeclElem e)
protected Env checkStmt(Env e, Stmt s)
(The returned environment will be the same as the one passed in unless the statement is a declaration.)
protected void checkForLoopAfterInit(Env se, ForStmt f)
protected Env checkStmtVec(Env env, StmtVec v)
protected Type[] checkExprVec(Env env, ExprVec ev)
protected VarInit checkInit(Env env, VarInit x, Type expectedResult)
protected Expr checkDesignator(Env env, Expr e)
protected Expr checkExpr(Env env, Expr expr, Type t)
protected Expr checkExpr(Env env, Expr x)
setType
on x
before its
done.
protected Type checkObjectDesignator(Env env, ObjectDesignator od)
private Type tryCondExprMatch(Expr leftExpr, Expr rightExpr)
protected Type checkBinaryExpr(int op, Expr left, Expr right, int loc)
static boolean checkIntegralType(Expr e)
static boolean checkNumericType(Expr e)
static boolean isVariable(Expr e)
public static VarInit setType(VarInit i, Type t)
protected static Type getTypeOrNull(VarInit i)
Type
of a VarInit
. This type is
associated with an expression by the typechecking pass. If the expression does
not have an associated type, then null is returned.
public static Type getType(VarInit i)
Type
of a VarInit
. This type is
associated with an expression by the typechecking pass. If the expression does
not have an associated type, then Assert.fail
is called.
private static void setBranchLabel(BranchStmt s, Stmt l)
static Stmt getBranchLabel(BranchStmt s)
Stmt
target of a BranchStmt
. This
Stmt
may be mentioned either explicitly (as in break
label;
), or implicitly (as in break;
) by the
BranchStmt
. The correct Stmt
target is associated
with the BranchStmt
by the typechecking pass. This type is
associated with an expression by the typechecking pass. If the
BranchStmt
does not have an associated Stmt
target,
then Assert.fail
is called.
static void checkType(Expr expr, Type t)
protected static void reportLookupException(LookupException e, java.lang.String s, java.lang.String t, int loc)
protected boolean assignmentConvertable(Expr e, Type t)
Types
, because it needs to mess with constants.
protected void checkTypeDeclElemPragma(TypeDeclElemPragma e)
protected Env checkModifierPragmaVec(ModifierPragmaVec v, ASTNode ctxt, Env env)
ModifierVec
s. The
ASTNode
is the parent of the ModifierPragma
, and
env
is the current environment.
protected Env checkModifierPragma(ModifierPragma p, ASTNode ctxt, Env env)
Modifier
s. The
ASTNode
is the parent of the ModifierPragma
, and
env
is the current environment.
protected Env checkStmtPragma(Env e, StmtPragma s)
protected Env checkTypeModifierPragmaVec(TypeModifierPragmaVec v, ASTNode ctxt, Env env)
protected Env checkTypeModifierPragma(TypeModifierPragma p, ASTNode ctxt, Env env)
protected Env checkTypeModifiers(Env env, Type t)
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |