info.aduna.gee.publication.servlets.car
Class Expression

java.lang.Object
  extended by info.aduna.gee.publication.servlets.car.Expression

public class Expression
extends Object


Field Summary
 ExpressionNode enode
          The top of the parse tree.
 Vector symbolQueue
          The symbol queue created for operator-precedence parsing.
 Stack symbolStack
          The operator, expression node stack created for operator-precedence parsing.
 
Constructor Summary
Expression()
           
Expression(String expr)
           
 
Method Summary
 boolean appendSymbol(Symbol sym)
          Append a symbol to the end of an expression.
 boolean eval(HashSet value)
          Evaluate the expression.
 String getErrMsg()
          Return a string indicates where the parsing error occurs.
static Symbol nextSymbol(StreamTokenizer st)
          Fetch the next symbol from the input expression string.
static Symbol toSymbol(String s)
          Convert a string to a symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enode

public ExpressionNode enode
The top of the parse tree.


symbolQueue

public Vector symbolQueue
The symbol queue created for operator-precedence parsing.


symbolStack

public Stack symbolStack
The operator, expression node stack created for operator-precedence parsing.

Constructor Detail

Expression

public Expression()

Expression

public Expression(String expr)
           throws ExpressionException
Throws:
ExpressionException
Method Detail

appendSymbol

public boolean appendSymbol(Symbol sym)
                     throws ExpressionException
Append a symbol to the end of an expression.

Returns:
true if the whole expression is reduced into a single expression node or if the expression is empty.
Throws:
ExpressionException

eval

public boolean eval(HashSet value)
Evaluate the expression.


toSymbol

public static Symbol toSymbol(String s)
Convert a string to a symbol.


nextSymbol

public static Symbol nextSymbol(StreamTokenizer st)
                         throws IOException,
                                ExpressionException
Fetch the next symbol from the input expression string.

Throws:
IOException
ExpressionException

getErrMsg

public String getErrMsg()
Return a string indicates where the parsing error occurs.



Copyright © 1997-2008 Aduna. All Rights Reserved.