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

cgodfrey86 cgodfrey at epnet.com
Mon May 19 09:38:09 PDT 2003


Thanks for your help.

I downloaded the grammar file from here as an example. When I try to 
generate class files from the grammar file  gnucparser.g, I see the 
following errors:

Can these errors then be ignored, or is there something I need to 
resolve in the make?

ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
error: grammar StdCLexer not defined
error: grammar StdCParser not defined

--- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
> 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 e...] 
> 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