polyglot.ast
Class Lit_c
java.lang.Object
polyglot.ast.Node_c
polyglot.ast.Term_c
polyglot.ast.Expr_c
polyglot.ast.Lit_c
- All Implemented Interfaces:
- java.lang.Cloneable, Expr, JL, Lit, Node, NodeOps, Prefix, Receiver, Term, Typed, Copy
- Direct Known Subclasses:
- BooleanLit_c, ClassLit_c, FloatLit_c, NullLit_c, NumLit_c, StringLit_c
public abstract class Lit_c
- extends Expr_c
- implements Lit
Lit
represents any Java literal.
Fields inherited from class polyglot.ast.Expr_c |
type |
Method Summary |
java.util.List |
acceptCFG(CFGBuilder v,
java.util.List succs)
Visit this term in evaluation order. |
abstract java.lang.Object |
constantValue()
Returns the constant value of the expression, if any. |
boolean |
constantValueSet()
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term. |
boolean |
isConstant()
Return whether the expression evaluates to a constant. |
Precedence |
precedence()
Get the precedence of the expression. |
Methods inherited from class polyglot.ast.Expr_c |
booleanValue, buildTypes, byteValue, charValue, doubleValue, dump, floatValue, intValue, isTypeChecked, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type |
Methods inherited from class polyglot.ast.Node_c |
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isDisambiguated, node, position, position, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, toString, translate, typeCheck, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, buildTypes, buildTypesEnter, checkConstants, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, typeCheckOverride, visitChildren |
Methods inherited from interface polyglot.util.Copy |
copy |
Methods inherited from interface polyglot.ast.Typed |
type |
Lit_c
public Lit_c(Position pos)
precedence
public Precedence precedence()
- Get the precedence of the expression.
- Specified by:
precedence
in interface Expr
- Overrides:
precedence
in class Expr_c
firstChild
public Term firstChild()
- Description copied from interface:
Term
- Return the first direct subterm performed when evaluating this term. If
this term has no subterms, this should return null.
This method is similar to the deprecated entry(), but it should *not*
recursively drill down to the innermost subterm. The direct child visited
first in this term's dataflow should be returned.
- Specified by:
firstChild
in interface Term
acceptCFG
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
- Description copied from class:
Term_c
- Visit this term in evaluation order.
- Specified by:
acceptCFG
in interface Term
- Specified by:
acceptCFG
in class Term_c
constantValueSet
public boolean constantValueSet()
- Specified by:
constantValueSet
in interface Expr
- Overrides:
constantValueSet
in class Expr_c
isConstant
public boolean isConstant()
- Description copied from interface:
Expr
- Return whether the expression evaluates to a constant.
This is not valid until after disambiguation.
- Specified by:
isConstant
in interface Expr
- Overrides:
isConstant
in class Expr_c
constantValue
public abstract java.lang.Object constantValue()
- Description copied from interface:
Expr
- Returns the constant value of the expression, if any.
- Specified by:
constantValue
in interface Expr
- Overrides:
constantValue
in class Expr_c