Bug 44504 - [patch] Improvements to FormulaParser - operators, precedence, error literals, etc
Summary: [patch] Improvements to FormulaParser - operators, precedence, error literals...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: Other All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-28 02:50 UTC by Josh Micich
Modified: 2008-03-04 08:49 UTC (History)
0 users



Attachments
svn diff of 10 changed files (86.64 KB, patch)
2008-02-28 02:51 UTC, Josh Micich
Details | Diff
tar bzip of 3 added files (2.61 KB, patch)
2008-02-28 02:52 UTC, Josh Micich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2008-02-28 02:50:02 UTC
There's some big changes here.  It's best to first look at all of the added test cases in TestFormulaParser to get an overview of the work.  (The new tests can be merged in first, to observe POI's current behaviour with

Added support for parsing of '%' in formulas.
Fixed operator precedence (and confirmed associativity):
	(), %, ^, * /, + -, &, = <> > >= < <= 
Simplified missing arg parse logic and confirmed with test
Added support for error literals (like #REF!) in formulas.
Fixed parsing of string literals
Simplified logic of rendering IF() and external functions

Started support for evaluation of external functions.

Made FormulaParser detect when the input string has not been consumed.  Removed all occurrences appending a semicolon to the formula before parsing (that code made no difference before).

Performed major refactorings inside FormulaParser to fix all of this.
Added class FormulaParser.FormulaParseException to help distinguish specific parsing errors from internal POI errors.
Comment 1 Josh Micich 2008-02-28 02:51:41 UTC
Created attachment 21598 [details]
svn diff of 10 changed files
Comment 2 Josh Micich 2008-02-28 02:52:31 UTC
Created attachment 21599 [details]
tar bzip of 3 added files
Comment 3 Nick Burch 2008-03-04 08:49:07 UTC
Applied to svn trunk, thanks