[antlr-interest] Grammar Inheritance for Newbies

Timothy Washington timothyjwashington at yahoo.ca
Sat Sep 2 17:31:26 PDT 2006


Hello there. I have another newbie question for which
I can't seem to find answers in the antlr docs.

I want to define my own lexical grammar rules. As
well, I want to be able to import and use some XML
grammar rules in a separate file. Through trial and
error, I've tried:

i) using 1 'importVocab' statement for each grammar
file/definition I want to use. This doesn't work as
antly only seems to pick up the first 'importVocab'
lexical rule. 

ii) trying to call 'exportVocab' in many files to the
same lexical class. This doesn't seem to work either
as the 2nd 'exportVocab' rule overwrites the first
one. 

iii) trying to have my custom 'Lexer' extend another
lexer. But this does not work as Grammar inheritance
only seems to work for Parsers. 

I'm at the end of my rope as I don't know how to do
this one simple thing. Am I missing something? Thanks
for any help. 


Tim


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the antlr-interest mailing list