I am writing an iPhone application that needs to parse a relatively simple set of expressions to be entered by the user.
I need a tool that allows me to introduce BNF (E) for the grammar, tell me if it is error-free, and tell me which parser is required to parse it, and also let me check if the expressions execute or not parse according to this grammar . This tool can be Objective-C, Java, or the command line. The simpler and cheaper the better.
Bison does not seem to allow me to enter my BNF as-is, and the effort required to test expressions against the resulting analyzer is a larger Yacc-shaving (ha!) Exercise than I am willing to participate.
Can someone point me to the active Java library, which will allow me to specify the grammar as BNF, check it and create a parser from it, which I can then use in JUnit tests, or a command line tool that will allow me to do something like this ?
source share