[antlr-interest] Error in http://www.antlr.org/wiki/display/ANTLR3/Pie

Terence Parr parrt at cs.usfca.edu
Thu Oct 28 08:53:12 PDT 2010


Sounds like you're right!
Ter
On Oct 27, 2010, at 8:01 PM, Juan Fernando Herrera J. wrote:

> There seems to be an error in Pie.g, where it reads
> 
> atom[boolean defer] returns [Object value]
>    :   INT     {if (!defer) $value = $INT.int;} // return int value
>    |   ID      {if (!defer) $value = interp.load($ID);} // look up value
>    |   CHAR    {if (!defer) $value = new Character($CHAR.text.charAt(1));}
>    |   FLOAT   {if (!defer) $value = new Float($FLOAT.text);}
>    |   STRING  {String s = $STRING.text; if (!defer) $value =
> s.substring(1,s.length()-1);}
>    |   structscope[defer] '.' ID // field access
>        {if ( !defer ) $value = interp.fieldload($structscope.value, $ID);}
>    |   'new' ID    {if (!defer) $value = interp.instance($ID.text);}
>    |   '(' expr[defer] ')'
> 
> Should the last line be
> 
>    |   '(' expr[defer] ')' {if (!defer) $value = $expr.value;}
> 
> ?
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list