[antlr-interest] Lack of understanding with importVocab

Jan van der Ven jhvdven at xs4all.nl
Wed Apr 18 11:32:46 PDT 2007


Dear list,


I am still working with 2.7.6. And I am tweaking a known grammar 
(DmlSQL2 and SqlSQL2) to the needs of our eclipse pluging QuantumDB. I 
also use AntlrStudio and I have the book. I definitely invested in this 
technology ;-).

Mr Vnuk (the author of DmlSQL2/SqlSQL2) made the one grammar inherit 
from the other, but Prashant's AntlrStudio plugin does not support this 
(and from what I read Antlr 3 will also not support inheritance), so I 
am merging the two of them now. I started with Dml (data manipulation) 
because a select is what we use most. The Sql grammar deals with data 
definition and alter statements and so on. The latter has an import 
vocabulary that is larger than the import vocabulary of dml and as far 
as I can see the two do not conflict (==same value for different tokens).

However, when I change the original dml import vocabulary to the sql 
vocabulary, all my JUnit tests fail for data manipulation, and succeed 
for data definition. If I change it back, the situation is reversed. 
That, I think I understand: the tokens for data definition are not 
defined. But I really do not understand why adding more tokens to a 
lexer, would cause the parser to throw NoViableAltExceptions.

Can someone tell me what it is I am missing here?

Thanks in advance,


Jan



More information about the antlr-interest mailing list