|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mmbase.util.ExprCalc
Class to calculate expressions. It implements a simple LL(1)
grammar to calculate simple expressions with the basic
operators +,-,*,/ and brackets.
The grammar in EBNF notation:
<expr> -> <term> { '+' <term> } | <term> { '-' <term> }
<term> -> <fact> { '*' <fact> } | <fact> { '/' <fact> }
<fact> -> <nmeral> | '(' <expr> ')'
| Constructor Summary | |
ExprCalc(java.lang.String input)
Constructor of ExrpCalc |
|
| Method Summary | |
double |
getResult()
Returns the calculated value of the expression |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ExprCalc(java.lang.String input)
input - a String representing the expression| Method Detail |
public double getResult()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||