[antlr-interest] Delegates grammar in ANTLR 3.1b1
Johannes Luber
jaluber at gmx.de
Sun Apr 6 09:10:12 PDT 2008
Edgar Espina schrieb:
> Hi all
>
> I'm parsing Java.g and it's ok. Now when i try to parse for example
> JavaDecl.g it fails and I see an error like this:
> error(107): JavaDecl.g:4:4: literal has no associated lexer rule:
> 'package'
> and it's because this:
> parser grammar JavaDecl;
>
> It's right? Can I parse JavaDecl alone?
AFAIK, you don't have to parse the grammar snippets alone. Some of those
files even reference other grammar parts, which are by definition
unavailable. Just parse the importing grammar and all imported grammars
are automatically included.
Johannes
More information about the antlr-interest
mailing list