Modifier and Type | Method and Description |
---|---|
<T> java.util.List<T> |
acceptCFG(Term n,
CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
Node |
addDefaultConstructor(ClassDecl n,
TypeSystem ts,
NodeFactory nf,
ConstructorInstance defaultConstructorInstance) |
Node |
checkConstants(Node n,
ConstantChecker cc)
Check if the node is a compile-time constant.
|
Type |
childExpectedType(Node n,
Expr child,
AscriptionVisitor av)
Get the expected type of a child expression of
this . |
boolean |
condIsConstant(Loop n,
JLang lang)
Returns true of cond() evaluates to a constant.
|
boolean |
condIsConstantFalse(Loop n,
JLang lang)
Returns true if cond() is a constant that evaluates to false.
|
boolean |
condIsConstantTrue(Loop n,
JLang lang)
Returns true if cond() is a constant that evaluates to true.
|
ExceptionChecker |
constructTryBlockExceptionChecker(Try n,
ExceptionChecker ec)
Construct an ExceptionChecker that is suitable for checking the try block of
a try-catch-finally AST node.
|
Term |
continueTarget(Loop n)
Target of a continue statement in the loop body.
|
Node |
disambiguate(Node n,
AmbiguityRemover ar)
Remove any remaining ambiguities from the AST.
|
NodeVisitor |
disambiguateEnter(Node n,
AmbiguityRemover ar)
Remove any remaining ambiguities from the AST.
|
Node |
disambiguateOverride(Node n,
Node parent,
AmbiguityRemover ar)
Disambiguate the AST.
|
Node |
exceptionCheck(Node n,
ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST.
|
java.util.List<Catch> |
exceptionCheckCatchBlocks(Try n,
ExceptionChecker ec)
Perform exception checking of the catch blocks of a try-catch-finally
AST node, using the supplied exception checker.
|
NodeVisitor |
exceptionCheckEnter(Node n,
ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST.
|
Block |
exceptionCheckFinallyBlock(Try n,
ExceptionChecker ec)
Perform exception checking of the finally block of a try-catch-finally
AST node (if there is one), using the supplied exception checker.
|
Block |
exceptionCheckTryBlock(Try n,
ExceptionChecker ec)
Perform exception checking of the try block of a try-catch-finally
AST node, using the supplied exception checker.
|
Type |
findContainer(Call n,
TypeSystem ts,
MethodInstance mi)
Used to find the missing static target of a static method call.
|
ClassType |
findEnclosingClass(New n,
Context c,
ClassType ct) |
TypeNode |
findQualifiedTypeNode(New n,
AmbiguityRemover ar,
ClassType outer,
TypeNode objectType) |
Expr |
findQualifier(New n,
AmbiguityRemover ar,
ClassType ct) |
ReferenceType |
findTargetType(Call n) |
Term |
firstChild(Term n)
Return the first direct subterm performed when evaluating this term.
|
void |
prettyPrintFooter(ClassDecl n,
CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintHeader(ClassDecl n,
CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintHeader(ProcedureDecl n,
Flags flags,
CodeWriter w,
PrettyPrinter tr) |
void |
printArgs(ProcedureCall n,
CodeWriter w,
PrettyPrinter tr) |
void |
printBody(New n,
CodeWriter w,
PrettyPrinter tr) |
void |
printQualifier(New n,
CodeWriter w,
PrettyPrinter tr) |
void |
printShortObjectType(New n,
CodeWriter w,
PrettyPrinter tr) |
java.util.List<Type> |
throwTypes(Node n,
TypeSystem ts)
List of Types of exceptions that might get thrown.
|
void |
typeCheckFlags(New n,
TypeChecker tc) |
void |
typeCheckNested(New n,
TypeChecker tc) |
Node |
typeCheckNullTarget(Call n,
TypeChecker tc,
java.util.List<Type> argTypes)
Typecheck the Call when the target is null.
|
addDecls, buildTypes, buildTypesEnter, constantValue, constantValueSet, copy, copy, dump, dump, enterChildScope, enterScope, extRewrite, extRewriteEnter, isConstant, prettyPrint, prettyPrint, prettyPrint, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChildren
Node disambiguateOverride(Node n, Node parent, AmbiguityRemover ar) throws SemanticException
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.ar
- The visitor which disambiguates.SemanticException
NodeVisitor disambiguateEnter(Node n, AmbiguityRemover ar) throws SemanticException
enter()
method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this
or a new copy of the node on which
visitChildren()
and leave()
will be
invoked.ar
- The visitor which disambiguates.SemanticException
Node disambiguate(Node n, AmbiguityRemover ar) throws SemanticException
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.
The node should not assume that its children have been disambiguated.
If it depends on a child being disambiguated,
it may just return this
without doing any work.ar
- The visitor which disambiguates.SemanticException
Type childExpectedType(Node n, Expr child, AscriptionVisitor av)
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.child
- A child expression of this node.av
- An ascription visitor.child
.Node checkConstants(Node n, ConstantChecker cc) throws SemanticException
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.cc
- The constant checking visitor.SemanticException
NodeVisitor exceptionCheckEnter(Node n, ExceptionChecker ec) throws SemanticException
enter()
method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this
or a new copy of the node on which
visitChildren()
and leave()
will be
invoked.ec
- The visitor.SemanticException
Node exceptionCheck(Node n, ExceptionChecker ec) throws SemanticException
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.ec
- The visitor.SemanticException
java.util.List<Type> throwTypes(Node n, TypeSystem ts)
Type findContainer(Call n, TypeSystem ts, MethodInstance mi)
ReferenceType findTargetType(Call n) throws SemanticException
SemanticException
Node typeCheckNullTarget(Call n, TypeChecker tc, java.util.List<Type> argTypes) throws SemanticException
argTypes
- list of Type
s of the argumentsSemanticException
void prettyPrintHeader(ClassDecl n, CodeWriter w, PrettyPrinter tr)
void prettyPrintFooter(ClassDecl n, CodeWriter w, PrettyPrinter tr)
Node addDefaultConstructor(ClassDecl n, TypeSystem ts, NodeFactory nf, ConstructorInstance defaultConstructorInstance) throws SemanticException
SemanticException
boolean condIsConstant(Loop n, JLang lang)
boolean condIsConstantTrue(Loop n, JLang lang)
boolean condIsConstantFalse(Loop n, JLang lang)
TypeNode findQualifiedTypeNode(New n, AmbiguityRemover ar, ClassType outer, TypeNode objectType) throws SemanticException
SemanticException
Expr findQualifier(New n, AmbiguityRemover ar, ClassType ct) throws SemanticException
SemanticException
void typeCheckFlags(New n, TypeChecker tc) throws SemanticException
SemanticException
void typeCheckNested(New n, TypeChecker tc) throws SemanticException
SemanticException
void printQualifier(New n, CodeWriter w, PrettyPrinter tr)
void printShortObjectType(New n, CodeWriter w, PrettyPrinter tr)
void printBody(New n, CodeWriter w, PrettyPrinter tr)
void printArgs(ProcedureCall n, CodeWriter w, PrettyPrinter tr)
void prettyPrintHeader(ProcedureDecl n, Flags flags, CodeWriter w, PrettyPrinter tr)
Term firstChild(Term n)
<T> java.util.List<T> acceptCFG(Term n, CFGBuilder<?> v, java.util.List<T> succs)
ExceptionChecker constructTryBlockExceptionChecker(Try n, ExceptionChecker ec)
ec
- The exception checker immediately prior to the try block.Block exceptionCheckTryBlock(Try n, ExceptionChecker ec) throws SemanticException
ec
- SemanticException
java.util.List<Catch> exceptionCheckCatchBlocks(Try n, ExceptionChecker ec) throws SemanticException
ec
- SemanticException
Block exceptionCheckFinallyBlock(Try n, ExceptionChecker ec) throws SemanticException
ec
- SemanticException