So far here is the skinny:
http://marc.theaimsgroup.com/?l=poi-dev&m=103973435403164&w=2
I find myself ill-motivated to work on formulas lately and I think I know why. We've seperated the issues in the formula parser poorly based on my earlier incorrect assumptions which makes it a real pain to work on. Avik has done a fine job on the parser but I think we need to seperate out some of the extra things it does.
I suggest:
FormulaParser Role: parses strings and throws token events
PTGParser Role: parses PTGs and throws token events
FormulaDigester Role: receives token events and outputs PTGs in RPN
PTGDigester Role: receives token events and outputs formula strings
Token: Role: Symbolic represnetation of a parsed portion of an expression.
PTG Role: Binary representation created by PTG Digester no direct correllation to tokens.
The goal is to seperate out the areas of concern. PTGs don't directly correspond to tokens in the formula string and vise versa. The order is therefore not *directly* RPN. This more distributed system should make it easier to do IFs and other constructs.
What do you guys think, esp Avik? Any additional formula volunteers?
Avik replied: http://marc.theaimsgroup.com/?l=poi-dev&m=103978983809104&w=2
I do think separation of concerns is a good thing, generally, and in relation to the formula code.
What i still havent come to grips with is the relation that we will have between the Token class and the PTG class .. actually dont know if its a concern at all.. need to think about this.
Separating the parser and digester is generally a good idea, with the only caveat that we'll have to be carefull not to create unnecessary objects.
Anyway, am going away on vacation tonight, will refactor away next weekend onwards.