Package org.scijava.parsington
Class SyntaxTree
java.lang.Object
org.scijava.parsington.SyntaxTree
- All Implemented Interfaces:
Iterable<SyntaxTree>
A syntax
tree corresponding to an expression.
- Author:
- Curtis Rueden
-
Constructor Summary
ConstructorsConstructorDescriptionSyntaxTree
(LinkedList<Object> tokens) Creates a syntax tree built from the given postfix token queue. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SyntaxTree
Creates a syntax tree built from the given postfix token queue. This process will consume the entire queue.- Parameters:
tokens
- The token queue, in postfix order.
-
-
Method Details
-
token
-
child
-
count
public int count() -
postfix
Converts the syntax tree into a token queue in postfix order.- Returns:
- Token queue representation of the syntax tree.
-
toString
-
equals
-
hashCode
public int hashCode() -
iterator
- Specified by:
iterator
in interfaceIterable<SyntaxTree>
-