public class JL5AssignExt extends JL5ExprExt
Constructor and Description |
---|
JL5AssignExt() |
Modifier and Type | Method and Description |
---|---|
Type |
childExpectedType(Expr child,
AscriptionVisitor av)
Get the expected type of a child expression of
this . |
boolean |
isBoolean(Type t) |
boolean |
isNumeric(Type t) |
Type |
numericType(Type t) |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
constantValue, constantValueSet, isConstant, node
acceptCFG, firstChild
addDecls, buildTypes, buildTypesEnter, checkConstants, copy, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, init, initPred, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
public Type childExpectedType(Expr child, AscriptionVisitor av)
NodeOps
this
.
The expected type is determined by the context in that the child occurs
(e.g., for x = e
, the expected type of e
is
the declared type of x
.
The expected type should impose the least constraints on the child's
type that are allowed by the parent node.childExpectedType
in interface NodeOps
childExpectedType
in class Ext_c
child
- A child expression of this node.av
- An ascription visitor.child
.public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
leave()
method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this
or a new copy of the node which will be
installed as a child of the node's parent.typeCheck
in interface NodeOps
typeCheck
in class Ext_c
tc
- The type checking visitor.SemanticException
public boolean isNumeric(Type t)
public boolean isBoolean(Type t)