[antlr-interest] Empty input files

Thomas Brandon tbrandonau at gmail.com
Thu Jul 6 06:29:12 PDT 2006


Currently passing an empty grammar to Antlr leads to it trying to create a
tree parser with a name of null. Would it be possible for it to instead give
some sort of no grammar defined error. Or just exit, you of course get other
errors. The issue is with an if block in CodeGenerator.java in
genRecognizer() where on line 377 there is:
else {
  recognizerST = templates.getInstanceOf("treeParser");
  ...
grammar.type is 0 but it is treated as a tree parser due to the unchecked
else.

Tom.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060706/98aa5b61/attachment.html


More information about the antlr-interest mailing list