Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Seeking Advice: Writing a parser

by Zaxo (Archbishop)
on Feb 08, 2002 at 05:14 UTC ( #144041=note: print w/ replies, xml ) Need Help??


in reply to Seeking Advice: Writing a parser

Math::Expr does exactly what you want. Release date is 2001-10-01, so it's fairly up to date.

     NAME
         Math::Expr - Parses mathematical expressions
SYNOPSIS use Math::Expr; SetOppDB(new Math::Expr::OpperationDB('<DBFileName>')); $e=Parse("a+4*b-d/log(s)+f(d,e)"); DESCRIPTION Parses mathematical expressions into a tree structure. The expressions may contain integers, real numbers, alphanumeric variable names, alphanumeric function names and most other characters might be used as operators...

From the pod. That's no reason not to write your own as an exercise :)

After Compline,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://144041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-08-26 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (365 votes). Check out past polls.