[antlr-interest] Preserving comments

Vitaliy Vitaliy at dbsophic.com
Wed Aug 13 05:52:29 PDT 2008


Hi All,



I went through the docs & archives,

But failed to find a good-enough way to preserve comments.



Let me explain what I mean by good-enough:

In the language I parse, comments can appear anywhere.

The grammar I've written for this language is pretty big - around 300 rules.

Whenever a comment is encountered in the input, some specific action must be executed for it.



I understand that I can use a special channel for comments,

But this would require me in each rule I've got, to check that channel for relevant comments.

Moreover, If I want to be precise, I would have to execute the action right after the comment, and not after the rule.



Is there any better way to do this?



Many thanks,

Vitaliy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080813/377023f5/attachment-0001.html 


More information about the antlr-interest mailing list