public class JL5CaseExt extends JL5TermExt implements JL5CaseOps
Constructor and Description |
---|
JL5CaseExt() |
Modifier and Type | Method and Description |
---|---|
Node |
checkConstants(ConstantChecker cc)
Check if the node is a compile-time constant.
|
Node |
disambiguateOverride(Node parent,
AmbiguityRemover ar)
Disambiguate the AST.
|
boolean |
isNumericSwitchType(Type switchType,
JL5TypeSystem ts) |
Case |
node()
The node we ultimately extend.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter . |
Case |
resolveCaseLabel(TypeChecker tc,
Type switchType) |
Node |
typeCheckOverride(Node parent,
TypeChecker tc)
Type check the AST.
|
acceptCFG, firstChild
addDecls, buildTypes, buildTypesEnter, childExpectedType, copy, copy, copy, disambiguate, disambiguateEnter, dump, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, init, initPred, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, typeCheck, typeCheckEnter, visitChild, visitChildren, visitList
public Case node()
Ext
node
in interface Ext
node
in class JL5TermExt
public Case resolveCaseLabel(TypeChecker tc, Type switchType) throws SemanticException
resolveCaseLabel
in interface JL5CaseOps
SemanticException
public boolean isNumericSwitchType(Type switchType, JL5TypeSystem ts)
public Node disambiguateOverride(Node parent, AmbiguityRemover ar) throws SemanticException
NodeOps
override()
method of the
visitor. If this method returns non-null, the node's children
will not be visited automatically. Thus, the method should check
both the node this
and it's children, usually by
invoking visitChildren
with tc
or
with another visitor, returning a non-null node. OR, the method
should do nothing and simply return null
to allow
enter
, visitChildren
, and leave
to be invoked on the node.
The default implementation returns null
.
Overriding of this method is discouraged, but sometimes necessary.disambiguateOverride
in interface NodeOps
disambiguateOverride
in class Ext_c
ar
- The visitor which disambiguates.SemanticException
public Node typeCheckOverride(Node parent, TypeChecker tc) throws SemanticException
NodeOps
override()
method of the
visitor. If this method returns non-null, the node's children
will not be visited automatically. Thus, the method should check
both the node this
and it's children, usually by
invoking visitChildren
with tc
or
with another visitor, returning a non-null node. OR, the method
should do nothing and simply return null
to allow
enter
, visitChildren
, and leave
to be invoked on the node.
The default implementation returns null
.
Overriding of this method is discouraged, but sometimes necessary.typeCheckOverride
in interface NodeOps
typeCheckOverride
in class Ext_c
tc
- The type checking visitor.SemanticException
public Node checkConstants(ConstantChecker cc) 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.checkConstants
in interface NodeOps
checkConstants
in class Ext_c
cc
- The constant checking visitor.SemanticException
public void prettyPrint(CodeWriter w, PrettyPrinter tr)
NodeOps
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class Ext_c
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.