[antlr-interest] Lexer.java output in wrong directory

Hilco Wijbenga hilco.wijbenga at gmail.com
Sun Sep 13 10:29:53 PDT 2009


2009/9/13 Martijn Reuvers <martijn.reuvers at gmail.com>:
> Not sure what you want with the import statement in the parser, but I
> assume you just want to just use the lexer grammar as input for your
> parser grammar, then you should use:

Yep, I'm just trying to break up the grammar into smaller pieces.

> L.g
>
> @header {
>  package x;
> }
>
>
> X.g:
>
> options {
>    tokenVocab=X;
> }
>
> @header {
>  package x;
> }

I'm probably not understanding you correctly but I can't get this to
even compile. I've tried some variations of what you listed above
("tokenVocab = L;"; with the import statement and without; with L.g in
x instead of imports) but none of it works. And in the cases where it
does output something, the lexer is still in the wrong directory.

Could you spell it out for me? :-) What should L.g say and where
should it be located? What should X.g say? Did you actually run it?

Cheers,
Hilco


More information about the antlr-interest mailing list