[antlr-interest] ANTLR4 options ignored in imported grammar

cd.barth at t-online.de cd.barth at t-online.de
Fri Oct 26 03:50:02 PDT 2012


ANTLR4 (v 4.0b2) works fine when I'm using separated lexer and parser
grammars 

 

lexer grammar CommonLexerRules;;

options {   superClass=LexerExtension; } .

 

parser grammar PLiParser;

options {   superClass=ParserExtension; }.

 

and generates accurate the lines

.public class PLiLexer extends LexerExtension {.

.public class PLiParser extends ParserExtension {.

 

But when I'm using the new cool feature for importing grammars like

 

grammar CombindedPLiGrammar;

import PLiLexer;

.

 

I get the warning : options ignored in imported grammar

 

The generated java file contains

.public class PLiLexer extends Lexer {.      instead of : extends
LexerExtension

 

My questions: 

Is there any way to set an LexerExtension in an imported grammar?

Any idea to fix Java.stg ?

 

Claus-Dieter



More information about the antlr-interest mailing list