Formula Parser-JEP removal

From PCGen Wiki
Revision as of 20:47, 30 April 2009 by Tom Parker (talk | contribs) (Created page with '{| align="right" | __TOC__ |} ==Background== From a code team discussion about tasks for PCGen 5.17, it was brought up that one project was additional work on formula proce...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Background

From a code team discussion about tasks for PCGen 5.17, it was brought up that one project was additional work on formula processing, JEP, output sheets. This discussion effectively starts in message DEV_2. This discussion led to considering the removal of JEP from PCGen.

Status

This is a proposal. It is not finalized, and is actively undergoing discussion. Please comment to the pcgen_developers list on this issue/proposal.

This Wiki is a summary page, it is NOT intended to host the discussion - please do not use it to carry on discussion.

Reasoning

The long-term discussion/proposal is around removing JEP from PCGen. This is a result of

  1. JEP is now a closed source library, so we cannot continue to benefit from future releases/bug fixes
  2. JEP is a license exception in our code, which restricts our license flexibility
  3. JEP has more features than we need (some of which get in our way)

Requirements

The following are the currently identified (proposed) requirements for a Formula Parser for PCGen:

  1. Recognize the bits that make up a PCGEN formula
  2. Follow mathematical precedence for operators
  3. Do not involve tens (hundreds) of recursive calls every time we evaluate a formula.
  4. Have the ability to complain at LST load (vs at runtime) if a formula is invalid, which means it also has the ability to detect and warn at LST load for deprecated formula styles, e.g. 2MAXINT

Potential Implementation Details/Future projects:

  1. Have a formula factory that can detect situations where a formula like 1+INT is used multiple places in the LST. These should be reduced via a cache to a single Formula object (since a Formula is immutable) to save memory and hopefully reduce LST load time.
  2. Make formula terms/variables into plugins, so the Formula system can be extended without modifying the core.

Proposal

Being developed, please see pcgen_developers list for current status.