[antlr-interest] Retaining Comments after parsing the file

vasanthi a vasanthi.ak at gmail.com
Tue Jun 2 03:03:47 PDT 2009


Hi

I am using ANTLR V 2, and in the code when I change from $channel=SKIP to
$channel=HIDDEN and I get a error
Token hidden cannot be resolved.
Can you please let me know how this can be resolved.
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/20090602/9f68588b/attachment.html 


More information about the antlr-interest mailing list