[antlr-interest] Possible Antlr defect?

Terence Parr parrt at cs.usfca.edu
Sat Jun 9 18:08:47 PDT 2007


On Jun 9, 2007, at 5:57 PM, Gavin Lambert wrote:

> At 12:38 10/06/2007, Terence Parr wrote:
> >
> >That "elsewhere in a grammar" is the key.  Just referencing a
> >token defines it as well as using the tokens section.
>
> That doesn't seem like a good idea -- it would make it vulnerable  
> to typos.  References to a token should be illegal unless they've  
> been specifically defined in a tokens section, been given a lexing  
> rule, or imported from a vocab file.

Yep.  It is vulnerable to typos, but only comes up when you're  
building separate parser and lexer (or a tree parser I guess).  I  
think ANTLRWorks puts a red squiggly line underneath if it is not  
defined.  I will have to check.

Ter


More information about the antlr-interest mailing list