[antlr-interest] Grammar Inheritance - can this apply to lexe rs?

mzukowski at yci.com mzukowski at yci.com
Mon May 19 09:17:56 PDT 2003


Inheritence is implemented by merging files together, so you may only use
inheritence from separate .g files.

To see a working example check out the gcc translation kit
www.codetransform.com/gcc.html

Monty

-----Original Message-----
From: cgodfrey86 [mailto:cgodfrey at epnet.com] 
Sent: Monday, May 19, 2003 9:14 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Grammar Inheritance - can this apply to lexers?


Hello,

Can grammar inheritance apply to lexers?

class UserLexer extends Lexer;

....
class LiteralLexer extends UserLexer;

....

If have definitions such as this in the same file, I get error
panic: You may only have one lexer per grammar file: class 
LiteralLexer

If I separate into 2 files, the second file does not recognize the 
first lexer class- is there a way to reference the class in the 
grammar file?

error: grammar UserLexer not defined

Thanks In Advance


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list