public class Constant extends Expression
Modifier and Type | Field and Description |
---|---|
String |
value
(¬ø) The text representing the constant.
|
parenthesized, typeCache, typeCacheFilled
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
Constant(int line,
int byteOffset,
String value)
Full constructor.
|
Constant(String value)
Initializing constructor.
|
Constant(TokenValue token)
Parser's constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
equals(Object o)
Two constants are equal when their
noQuotes() methods return the same thing. |
int |
hashCode()
Returns a hash code value for java hash structures.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
String |
noQuotes()
Returns the contents of
value removing unescaped double quotes. |
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
containsQuantifiedVariable, getVariableTypes, senseValueChild
public String value
public Constant(TokenValue token)
token
- The parser's token for the constant.public Constant(String value)
value
- The text representation of the constant.public Constant(int line, int byteOffset, String value)
line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.value
- The text representation of the constant.public String noQuotes()
value
removing unescaped double quotes.value
with unescaped double quotes removed.public int hashCode()
public boolean equals(Object o)
noQuotes()
methods return the same thing.equals
in class Object
true
iff this object is the same as the argument.noQuotes()
public ASTNodeIterator iterator()
public Object clone()
public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.Copyright © 2016. All rights reserved.