org.scijava.sjep
Class SyntaxTree
java.lang.Object
org.scijava.sjep.SyntaxTree
- All Implemented Interfaces:
- Iterable<SyntaxTree>
public class SyntaxTree
- extends Object
- implements Iterable<SyntaxTree>
A syntax
tree corresponding to an expression.
- Author:
- Curtis Rueden
SyntaxTree
public SyntaxTree(LinkedList<Object> tokens)
- 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.
token
public Object token()
child
public SyntaxTree child(int index)
count
public int count()
postfix
public LinkedList<Object> postfix()
- Converts the syntax tree into a token queue in postfix order.
toString
public String toString()
- Overrides:
toString in class Object
iterator
public Iterator<SyntaxTree> iterator()
- Specified by:
iterator in interface Iterable<SyntaxTree>
Copyright © 2015 SciJava. All rights reserved.