work on PowerPtg

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352521 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew C. Oliver 2002-04-28 15:17:44 +00:00
parent 700efbc430
commit fd71ea023c

View File

@ -310,10 +310,11 @@ public class FormulaParser {
/** Parse and Translate a Math Term */ /** Parse and Translate a Math Term */
private void Term(){ private void Term(){
Factor(); Factor();
while (Look == '*' || Look == '/' ) { while (Look == '*' || Look == '/' || Look == '^') {
///TODO do we need to do anything here?? ///TODO do we need to do anything here??
if (Look == '*') Multiply(); if (Look == '*') Multiply();
if (Look == '/') Divide(); if (Look == '/') Divide();
if (Look == '^') Power();
} }
} }
@ -332,6 +333,12 @@ public class FormulaParser {
tokens.add(new SubtractPtg()); tokens.add(new SubtractPtg());
} }
private void Power() {
Match('^');
Term();
tokens.add(new PowerPtg());
}
/** Parse and Translate an Expression */ /** Parse and Translate an Expression */
private void Expression() { private void Expression() {