Multiple super grammars
Brought to you by:
tjuerge
Specifying a supergrammar which itself has a
supergrammar causes an error specifying it can't find
the grandparent. i.e. you can specify only one file for
the -glib option in the Antlr-preferences screen.
It can currently be circumvented by manually editing
the .antlr-eclipse file. However a neater solution
would be better imho.
I can see two possible ways to fix this:
1. Allow people to select multiple files in the
supergrammar box.
2. Check if the supergrammar has supergrammar in it's
.antlr-eclipse definition, if so add it to the -glib
parameter. And do this recursively.
While the first option is more powerful, the second
feels neater. It might even be possible to implement
them both.
Hi,
I have updated this mechanism a bit.
1)
Previously it was possible to set the super grammar for each grammar file.
Now it is also possible to set the import grammar (in case you have lexer + parser + tree parser setups).
2)
I have changed the compilation order.
I first build up a graph from the supper grammar and import vocabulary settings.
Than I traverse them automatically in an ordered fashion, so that required grammars are compiled before the one requiring them.
This mechanism might solve your problem too.
In my case I can compile a graph of 20+ grammar files automatically, without problems.