public final class Number extends ASTBase implements Expression
Constructor and Description |
---|
Number(java.lang.String digits)
construct number from digit representation
|
Modifier and Type | Method and Description |
---|---|
AST |
accept(ASTVisitor visitor)
Accept visitor for a visit.
|
java.lang.String |
getDigits()
get digit representation of number
|
int |
getPriority()
get binding level for printing (lower numbers mean greater binding power)
|
Expression |
instantiate()
return copy of AST with value references instantiated by the substitutions
set in the corresponding declaration identifiers
|
void |
print(java.io.PrintWriter out)
Prints text representation of tree on out (without new line termination).
|
void |
printCore(java.io.PrintWriter out)
Prints text representation of tree on out (without new line termination).
|
void |
printPriority(int treshold,
java.io.PrintWriter out)
print expression, use parentheses if priority is greater than treshold
|
printParens, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
printParens, toString
public Number(java.lang.String digits)
digits
- the digit representationpublic java.lang.String getDigits()
public int getPriority()
getPriority
in interface Expression
public void printCore(java.io.PrintWriter out)
public void print(java.io.PrintWriter out)
public void printPriority(int treshold, java.io.PrintWriter out)
printPriority
in interface Expression
treshold
- priority level of enclosing expressionout
- writer to print expression onpublic Expression instantiate()
instantiate
in interface Expression
public AST accept(ASTVisitor visitor)