I've been using the beta v3 of ANTLR to great effect for generating
language parsers, but there may already be a grammar in there that you
can use:

www.antlr.org

Mark

On 1/17/07, Richard Kroll <[EMAIL PROTECTED]> wrote:
> I am currently creating a wiki style parsing engine for the lack of a
> better description.  To date I have all the HTML elements parsing that I
> need, but one of the requirements that I have is to allow the end user
> to input variables from our system (kind of a merge field) and allow
> them to perform math operations on them.  I was hoping that someone
> might know of an existing CF math parsing engine / code that I might be
> able to get a foothold on how to accomplish this.
>
> Anyone know of an existing open source library?
>
> The current requirement is to allow for basic arithmetic but including
> nesting parenthesis for more complex equations.  I have some ideas for
> the basic math, but when getting into nesting equations is where I get a
> little fuzzy.
>
> This is what I am trying to achieve in wiki markup:
>
> [b]Welcome[/b]
> [p]
> Product Commission is
> [math]({product_price}-{product_credits})*{commission_rate}[/math]
> [/p]
>
> Using my existing code I can get it to generate the correct [math] like:
>
> (100000-500)*.15
>
> I thought of simply tossing an eval() around this, but it seems like a
> major hack and does not allow for more complex equations that might come
> up later.
>
> Anyone have any ideas?
>
> Rich Kroll
>
> Senior Technical Lead
>
> SITE Manageware, Inc.
> 2841 West Cypress Creek Road
> Fort Lauderdale, Florida 33309
> 954-944-9020 EXT. 716
> 954-272-8916 Fax
>
>
>
> This communication is intended for use only by the individual(s) to whom
> it is specifically addressed and should not be read by, or delivered to,
> any other person.  Such communication may contain privileged or
> confidential information.  If you have received this message in error,
> please notify us immediately by returning the communication to the
> sender, or by sending it to [EMAIL PROTECTED]
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266716
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to