From fd71ea023c2b0c99f00d59e43810df3b2ac151da Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Sun, 28 Apr 2002 15:17:44 +0000 Subject: [PATCH] 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 --- .../apache/poi/hssf/record/formula/FormulaParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java index f27e0fff0..b364cb7c2 100644 --- a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java @@ -310,10 +310,11 @@ public class FormulaParser { /** Parse and Translate a Math Term */ private void Term(){ Factor(); - while (Look == '*' || Look == '/' ) { + while (Look == '*' || Look == '/' || Look == '^') { ///TODO do we need to do anything here?? if (Look == '*') Multiply(); if (Look == '/') Divide(); + if (Look == '^') Power(); } } @@ -332,6 +333,12 @@ public class FormulaParser { tokens.add(new SubtractPtg()); } + private void Power() { + Match('^'); + Term(); + tokens.add(new PowerPtg()); + } + /** Parse and Translate an Expression */ private void Expression() {