Extension SDK 10.1.2

oracle.javatools.parser.util
Class ExpressionStack

java.lang.Object
  extended byoracle.javatools.parser.util.ArrayListHeap
      extended byoracle.javatools.parser.util.ExpressionStack

public class ExpressionStack
extends ArrayListHeap

The ExpressionStack is used for generating an expression tree out of a stream of expressions in infix notation. Expressions should implement the ExpressionObject interface. To use, instantiate an ExpressionStack object and provide your stream of expressions to this ExpressionStack via the add(...) method. When done, call process() to process through the expressions and generate the expression tree. The tree is built via ExpressionObject's addOperand(...) and closeOperator(...) methods.


Constructor Summary
ExpressionStack()
           
 
Method Summary
 void add(ExpressionObject e)
          Adds an ExpressionObject as in an infix stream.
 ExpressionObject process()
          Takes the stream of ExpressionObjects in infix order via the method add(...) and generates a tree of ExpressionObjects.
 void setClosingArgument(java.lang.Object arg)
           
 
Methods inherited from class oracle.javatools.parser.util.ArrayListHeap
allocArrayList, freeArrayList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionStack

public ExpressionStack()
Method Detail

add

public void add(ExpressionObject e)
Adds an ExpressionObject as in an infix stream.


setClosingArgument

public void setClosingArgument(java.lang.Object arg)

process

public ExpressionObject process()
Takes the stream of ExpressionObjects in infix order via the method add(...) and generates a tree of ExpressionObjects.

Returns:
The root ExpressionObject of the new tree.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.