Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MorphingDragon

macrumors 603
Original poster
Mar 27, 2009
5,160
6
The World Inbetween
Is there any C (Preferred) or C++ libraries that will take a string and check if it matches a formal grammar or its BNF notation? Writing a robust library (as I found out) is not a trivial task.
 
Last edited:

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Yacc/Bison are parser generators, and should already installed as well. They will generate a parser from a set of rules similar to BNF. I have never used any of them though, writing a recursive descent parser is not that hard though depending on what you are up to, (I have done it for math expressions).
 

lloyddean

macrumors 65816
May 10, 2009
1,047
19
Des Moines, WA
I know you said C preferred but perhaps "Spirit" a member of the BOOST project.

<http://www.ibm.com/developerworks/aix/library/au-boost_parser/>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.