Reputation: 15
lets say I have a language designed. What are the criteria to consider when it comes to selecting the "proper" parser/framework (javacc, antlr, spark, mps...), like performance, test generation, IDE support....
I know, "proper" depends on a lot of variables, but I am only interested in the list of criteria (I'll do weighting afterwards) upon which I could base and make my decision.
Thx for any input!
Upvotes: 0
Views: 134
Reputation: 7409
LALR(1) parsers can be very fast because they can be based on pre-compiled tables, but one-character lookahead can limit your grammar. A great example is the GOLD Parser. With many engines to choose from, even though it's old, it is rather fast if you can describe your grammar using just BNF.
Upvotes: 0
Reputation: 12450
The most important input for such decision will likely be the complexity of the language. Different parser generators are able to process different classes of languages.
As your language will likely be a context-free language (otherwise you either can get away with a regex or you're up to quite a challenge), you'll usually be deciding between a LR parser (or some variant thereof) and LL parser. As a (simplified!) rule of thumb, LR parsers are able to parse more complicated languages, while LL parsers are more intuitive and easier to understand.
Other criteria that I find important are:
Upvotes: 1