[antlr-interest] Island Grammars with identical tokens

Mike J. Bell ckimyt at gmail.com
Thu May 21 07:56:32 PDT 2009


On Thu, May 21, 2009 at 10:24 AM, Thomas Brandon <tbrandonau at gmail.com> wrote:
> You should be able to use the importVocab option to specify a common
> .tokens file for all lexers to import. Or you can chain the lexers by
> having one island grammar import the vocab of the other and then have
> the main grammar import that island grammars vocab. That will avoid
> the need to keep the manually generated common token file in sync.
> Though then you will need to check if ANTLR's build ordering can
> handle this dependency or else make sure you enforce the build order
> manually or tokens will get out of sync.

You meant tokenVocab...thanks, this did the trick!!!  (I get warnings
about "no lexer rule corresponding to token ..." but the generated
code seems to be OK).

Thanks!!!

-- 
Mike J. Bell on gmail


More information about the antlr-interest mailing list