public interface Expr extends Receiver, Term
Expr
represents some Java expression. All expressions
must be subtypes of Expr.Term.Instance
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
constantValue()
Deprecated.
|
boolean |
constantValueSet()
Deprecated.
|
boolean |
isConstant()
Deprecated.
|
Precedence |
precedence()
Get the precedence of the expression.
|
void |
printSubExpr(Expr expr,
boolean associative,
CodeWriter w,
PrettyPrinter pp)
Correctly parenthesize the subexpression
expr
based on its precedence and the precedence of this expression. |
void |
printSubExpr(Expr expr,
CodeWriter w,
PrettyPrinter pp)
Correctly parenthesize the subexpression
expr
based on its precedence and the precedence of this expression. |
Expr |
type(Type type)
Return an equivalent expression, but with the type
type . |
del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitList
exceptions, exceptions, reachable, reachable
Precedence precedence()
@Deprecated boolean constantValueSet()
isConstant()
is valid only if
constantValueSet()
is true.@Deprecated boolean isConstant()
constantValueSet()
is true.@Deprecated java.lang.Object constantValue()
isConstant()
is true.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. For example,
we parenthesize the right subexpression of a left-associative operator.expr
- The subexpression.associative
- Whether expr is the left (right) child of a left-
(right-) associative operator.w
- The output writer.pp
- The pretty printer.void printSubExpr(Expr expr, 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 do not parenthesize.
This is equivalent to printSubexpr(expr, true, w, pp)
expr
- The subexpression.w
- The output writer.pp
- The pretty printer.