[antlr-interest] Error output from org.antlr.Tool with language=Python, but generates code OK

Kevin J. Cummings cummings at kjchome.homeip.net
Sat Sep 25 13:21:36 PDT 2010


On 09/25/2010 02:12 PM, Arthur Perry wrote:
> I am getting the same error - did you ever figure out the issue?

In Bernt's example below, prog is an empty rule.  Not a good idea.
Probably deserving of a better error message though.

If this is specific to the python project, you'd have to get an answer
from one of the Python maintainers.

> Art
> 
> 
>> ---- bernt wrote: ----
>>
>> When executing the command:
>>
>> java -cp antlrworks-1.2.2.jar org.antlr.Tool Expr.g
>>
>> on a minimal Expr.g file (and any other grammar file with language=Python):
>> ---
>> grammar Expr;
>> options {
>>        language=Python;
>> }
>>
>> prog:;
>> ---
>>
>> the following happens:
>>
>> - the tool exits with error code 1, and writes an error message to the console:
>> ANTLR Parser Generator  Version 3.1.1
>> error(10):  internal error: eval tree parse error : <AST>:0:0:
>> unexpected AST node:
>>
>> org.antlr.stringtemplate.language.ActionEvaluator.expr(Unknown Source)
>> ...
>> ...
>> org.antlr.Tool.main(Unknown Source)
>>
>> - but the ExprParser.py file is generated just fine.
>>
>>
>> Is there something wrong in org.antlr.Tool? Or am I doing something wrong?
>>
>> Regards,
>> Bernt

-- 
Kevin J. Cummings
kjchome at rcn.com
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)


More information about the antlr-interest mailing list