|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.cheffo.jeplite.JEP
Constructor Summary | |
JEP()
|
Method Summary | |
void |
addFunction(java.lang.String functionName,
java.lang.Object function)
Adds a new function to the parser. |
void |
addStandardConstants()
Adds the constants pi and e to the parser. |
void |
addStandardFunctions()
Adds the standard functions to the parser. |
java.lang.Double |
addVariable(java.lang.String name,
double value)
Adds a new variable to the parser, or updates the value of an existing variable. |
java.lang.String |
getErrorInfo()
Reports information on the error in the expression |
SimpleNode |
getTopNode()
|
double |
getValue()
Evaluates and returns the value of the expression. |
double |
getValue(DoubleStack evalStack)
|
ASTVarNode |
getVarNode(java.lang.String var)
|
boolean |
hasError()
Reports whether there is an error in the expression |
void |
initFunTab()
Initializes the function table |
void |
initSymTab()
Initializes the symbol table |
void |
parseExpression(java.lang.String expression_in)
Parses the expression |
void |
setVarNode(java.lang.String var,
ASTVarNode node)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JEP()
Method Detail |
public void initSymTab()
public void initFunTab()
public void addStandardFunctions()
public void addStandardConstants()
public void addFunction(java.lang.String functionName, java.lang.Object function)
public java.lang.Double addVariable(java.lang.String name, double value)
name
- Name of the variable to be addedvalue
- Initial value or new value for the variable
public ASTVarNode getVarNode(java.lang.String var)
public void setVarNode(java.lang.String var, ASTVarNode node)
public void parseExpression(java.lang.String expression_in)
expression_in
- The input expression stringpublic double getValue() throws ParseException
ParseException
public SimpleNode getTopNode()
public double getValue(DoubleStack evalStack) throws ParseException
ParseException
public boolean hasError()
public java.lang.String getErrorInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |