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?

Recommended Answers

All 4 Replies

Why don't you use the Python interpreter...It does a great job of parsing

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.

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.