[antlr-interest] Why ANTLR doesn't check existence of lexical symbols?

Terence Parr parrt at jguru.com
Wed Jun 11 10:28:12 PDT 2003


On Wednesday, June 11, 2003, at 02:11  AM, Hrvoje Nezic wrote:

> Hi,
>
> If some lexical symbol is referenced in parser grammar,
> but is not actually defined in lexer, ANTLR doesn't
> generate error or warning messages, so this can be detected
> only at runtime on parser testing.
> I find it very inconvenient, because you have to check
> existence of token symbols manually.
> Is there any reason why ANTLR behaves like this, and
> is there any workaround?

The problem is that ANTLR can be hooked up to any TokenStream object.  
Further, the lexer may not be defined in the same grammar file.  ANTLR 
cannot answer this question, I guess is the answer (though not the one 
you are hoping for) ;)

Terence
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Co-founder, http://www.peerscope.com link sharing, pure-n-simple
Lecturer in Comp. Sci., University of San Francisco


 

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




More information about the antlr-interest mailing list