Math lexer/parser

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Feb 2007
Posts: 1,606
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Math lexer/parser

 
0
  #1
Sep 21st, 2009
Is there an open source (lgpl, bsd, mit) math parser/lexer library available out there? Has anybody ever written one by themselves (with support for variables, exponents, grouping) and have some tips/hints?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 363
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 46
gerard4143's Avatar
gerard4143 gerard4143 is offline Offline
Posting Whiz

Re: Math lexer/parser

 
0
  #2
Sep 21st, 2009
Why don't you use the Python interpreter...It does a great job of parsing
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,606
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: Math lexer/parser

 
0
  #3
Sep 21st, 2009
Originally Posted by gerard4143 View Post
Why don't you use the Python interpreter...It does a great job of parsing
I could use the intepreter to evaluate, but that's not what I want. I want to parse the expressions into data structures that I can easily inspect in code.

So... this question is still open.
Last edited by scru; Sep 21st, 2009 at 7:24 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 930
Reputation: Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough 
Solved Threads: 216
Gribouillis's Avatar
Gribouillis Gribouillis is offline Offline
Posting Shark

Re: Math lexer/parser

 
1
  #4
Sep 21st, 2009
A nice LR(1) parser is wisent. Simple to use and efficient. Also it generates parsers independant of wisent, so that a user of your program wouldn't need wisent to run your wisent-generated parser.
Last edited by Gribouillis; Sep 21st, 2009 at 9:44 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,606
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: Math lexer/parser

 
0
  #5
Sep 26th, 2009
Originally Posted by Gribouillis View Post
A nice LR(1) parser is wisent. Simple to use and efficient. Also it generates parsers independant of wisent, so that a user of your program wouldn't need wisent to run your wisent-generated parser.
Thanks for the suggestion. I've been able to use wisent for what I want.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC