public class IntLit_c extends NumLit_c implements IntLit
IntLit represents a literal in Java of an integer
type.IntLit.KindTerm.Instance| Modifier and Type | Field and Description |
|---|---|
protected IntLit.Kind |
kind
The kind of literal: INT or LONG.
|
exceptions, reachable| Constructor and Description |
|---|
IntLit_c(Position pos,
IntLit.Kind kind,
long value) |
IntLit_c(Position pos,
IntLit.Kind kind,
long value,
Ext ext) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
boundary()
Is this a boundary case, i.e., max int or max long + 1?
|
java.lang.Object |
constantValue(Lang lang)
Return the constant value of the expression, if any.
|
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
IntLit.Kind |
kind()
Get the kind of the literal: INT or LONG.
|
IntLit |
kind(IntLit.Kind kind)
Set the kind of the literal: INT or LONG.
|
protected <N extends IntLit_c> |
kind(N n,
IntLit.Kind kind) |
java.lang.String |
positiveToString()
Print the string as a positive number.
|
Precedence |
precedence()
Get the precedence of the expression.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter. |
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
long |
value()
Get the literal's value.
|
IntLit |
value(long value)
Set the literal's value.
|
protected <N extends IntLit_c> |
value(N n,
long value) |
acceptCFG, constantValueSet, firstChild, isConstantbooleanValue, buildTypes, byteValue, charValue, constantValue, constantValueSet, doubleValue, extRewrite, floatValue, intValue, isConstant, isTypeChecked, lastLang, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type, typeexceptionCheck, exceptions, exceptions, exceptions, listChild, reachable, reachable, reachableaddDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitListclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconstantValue, constantValueSet, isConstant, printSubExpr, printSubExpr, typedel, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdgeaddDecls, buildTypes, buildTypesEnter, checkConstants, childExpectedType, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitChildren, visitListexceptions, exceptions, reachable, reachableprotected IntLit.Kind kind
public IntLit_c(Position pos, IntLit.Kind kind, long value)
public IntLit_c(Position pos, IntLit.Kind kind, long value, Ext ext)
public boolean boundary()
IntLitpublic long value()
IntLitpublic IntLit value(long value)
IntLitprotected <N extends IntLit_c> N value(N n, long value)
public IntLit.Kind kind()
IntLitpublic IntLit kind(IntLit.Kind kind)
IntLitprotected <N extends IntLit_c> N kind(N n, IntLit.Kind kind)
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOpsleave() 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.typeCheck in interface NodeOpstypeCheck in class Node_ctc - The type checking visitor.SemanticExceptionpublic java.lang.String positiveToString()
IntLitpositiveToString in interface IntLitpublic void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_cCodeWriter.prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.public java.lang.Object constantValue(Lang lang)
ExprOpsisConstant() is true.constantValue in interface ExprOpsconstantValue in class Lit_cpublic Precedence precedence()
Exprprecedence in interface Exprprecedence in class Lit_c