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

Ric Klaren klaren at cs.utwente.nl
Wed Jun 11 13:53:19 PDT 2003


On Wed, Jun 11, 2003 at 11:11:39AM +0200, Hrvoje Nezic wrote:
> 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?

I'm not 100% sure atm, if this behaviour is still in antlr. I once patched
it that if you define all stuff in the tokens section that a warning is
issued if you define stuff outside it. But it could well be that this
change was vetoed somewhere. (Not able to do a quick test atm)

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  "I don't have anything against Java - it's the best damn implementation
              of UCSD Pascal ever released..." --- Larry Smith


 

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




More information about the antlr-interest mailing list