I'm trying to use Irony to parse C99, and I found a grammar online to guide me.
I'm having difficulty with conflicts on declaration versus statement. The following rule fails to detect a pointer declaration with initializer.
blockItemList.Rule = MakePlusRule(blockItemList, blockItem);
blockItem.Rule = declaration | statement;
The type of line it's failing on would be:
MyType *x = foo();
When I remove labeledStatement and expressionStatement from statement's rule (both may start with identifier), this type of declaration is recognized correctly.
What's the best way to force Irony to exhaust the declaration rule before trying statement? Or, can I add to the grammar as Irony parses so that it can register MyType as a terminal rather than an identifier?