[antlr-interest] Retaining Comments after parsing the file

vasanthi a vasanthi.ak at gmail.com
Mon Apr 20 05:34:55 PDT 2009


Hi All
But when I try to use this syntax it says undefined symbol $.
The below mentioned syntax is java
"undefined char $'

Vasanthi.

On Sun, Apr 19, 2009 at 10:48 PM, Tilman Bender <
tbender at stud.hs-heilbronn.de> wrote:

> Hi,
> The problem is, that you use skip() where you should actually use something
> like:
>
> : "//" (~('\r'|'\n'))* {$channel=HIDDEN;}
>
> This way the comment will still be acessible in the parser:
>
> http://www.antlr.org/wiki/pages/viewpage.action?pageId=557063
>
> HTH
>
>  Tilman Bender
> Student des Software Engineering
> Hochschule Heilbronn
> tbender at stud.hs-heilbronn.de
>
>
>
>  Am 19.04.2009 um 16:28 schrieb vasanthi a:
>
>  SL_COMMENT
>
> : "//" (~('\r'|'\n'))* {$setType(Token.SKIP);}
> ;
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090420/92456b6f/attachment.html 


More information about the antlr-interest mailing list