|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.statcato.calculator.MathExpParserComplete
public class MathExpParserComplete
A parser for mathematical expressions using the recurive descent algorithm. Acceptable expressions are defined by the following grammar:
E -> T { ("+" | "-") T}
T -> F { ("*" | "/") F}
F -> P {"^" F}
P -> v | "(" E ")" | "-" T | func_name"(" E ")" | Cx | "'" L "'"
L -> column_label
where expressions enclosed by { } can appear zero or more times.
| Constructor Summary | |
|---|---|
MathExpParserComplete(Spreadsheet sp)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getError()
Returns error message from the scanner. |
CompUnit |
parse(java.lang.String exp,
boolean isRadian)
Parses the given expression. |
CompUnit |
S()
Parses a statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MathExpParserComplete(Spreadsheet sp)
| Method Detail |
|---|
public CompUnit parse(java.lang.String exp,
boolean isRadian)
exp - expression in stringisRadian - boolean value of whether radians are usedpublic java.lang.String getError()
public CompUnit S()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||