|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Expr
An Expr
represents any Java expression. All expressions
must be subtypes of Expr.
Method Summary | |
---|---|
java.lang.Object |
constantValue()
Returns the constant value of the expression, if any. |
boolean |
isConstant()
Return whether the expression evaluates to a constant. |
Precedence |
precedence()
Get the precedence of the expression. |
void |
printSubExpr(Expr expr,
boolean associative,
CodeWriter w,
PrettyPrinter pp)
Correctly parenthesize the subexpression expr |
void |
printSubExpr(Expr expr,
CodeWriter w,
PrettyPrinter pp)
Correctly parenthesize the subexpression expr |
Expr |
type(Type type)
Return an equivalent expression, but with the type type . |
Methods inherited from interface polyglot.ast.Node |
---|
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
---|
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
---|
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren |
Methods inherited from interface polyglot.util.Copy |
---|
copy |
Methods inherited from interface polyglot.ast.Typed |
---|
type |
Methods inherited from interface polyglot.ast.Term |
---|
acceptCFG, entry, exceptions, exceptions, reachable, reachable |
Method Detail |
---|
Expr type(Type type)
type
.
Precedence precedence()
boolean isConstant()
java.lang.Object constantValue()
void printSubExpr(Expr expr, boolean associative, CodeWriter w, PrettyPrinter pp)
expr
based on its precedence and the precedence of this expression.
If the sub-expression has the same precedence as this expression
we parenthesize if the sub-expression does not associate; e.g.,
we parenthesis the right sub-expression of a left-associative
operator.
printSubExpr
void printSubExpr(Expr expr,
CodeWriter w,
PrettyPrinter pp)
- Correctly parenthesize the subexpression
expr
based on its precedence and the precedence of this expression.
This is equivalent to printSubexpr(expr, true, w, pp)
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD