[antlr-interest] $ in action comments

Benjamin Niemann pink at odahoda.de
Thu Feb 21 11:48:03 PST 2008


Gavin Lambert wrote:

> At 06:30 22/02/2008, Ian Moor wrote:
>  >I have finally tracked down two errors from generating a tree
>  >parser:
>  >error(111): pico/Gen.g:16:9: reference to attribute outside of a
> 
>  >rule: zero
>  >error(114): pico/Gen.g:454:11: attribute is not a token,
> parameter,
>  >or return value: v0
>  >
>  > in the first case there is a  // comment in the
> members  sections
>  >containing $zero, and in the second case there is a comment  in
> an
>  >action containing a $v0.
> 
> ANTLR doesn't understand the syntax of the target language, so it
> doesn't know what are comments and what aren't.  The only things
> it looks for are $s (to expand), }s (to terminate the block), and
> {s (to avoid terminating too early).

And % - which always bites me!

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/



More information about the antlr-interest mailing list