[antlr-interest] Labels Expanded w/in Action Comments
Johannes Luber
jaluber at gmx.de
Wed Aug 13 03:14:13 PDT 2008
Foust schrieb:
> $references are being expanded within action code comments.
>
> Did this issue get added to the bug database?
>
> I received some responses that this is the intended behavior, but surely you
> don't expect people to delete their action code when debugging, rather than
> just commenting it out?
>
> The issue here is the line comment (//), since some attribute references
> (like 'text') are expanded to several lines, making the resultant code not
> compilable.
>
> I'm sure that there are several possible solutions, but one would be to
> directly support the C/C++/Java line comment in Antlr, unless turned off by
> an option. Another solution would be to allow language specific definition
> of line and block comments. Good editors do this.
>
> Brent
Well, it is possible to fix this behaviour, but ANTLR has to be
bootstrapped first. Currently the tool is maintained in a ANTLR 2
grammar, which has some limitations. Only if we have an ANTLR in an
ANTLR 3 grammar, we can use grammar inheritance to adapt the target code
recognition to recognize the comments correctly. I don't know when Ter
will finish this task, but he said it was too much work to include it in
3.1. Maybe he finishes it for 3.2?
Johannes
P.S.: Please don't use another email to create a reply email and change
the subject line to something different. There are people who use
mailing list threading to order related emails in handy trees and not
creating a an entirely new email for new subjects screws that up. Any
good email client should allow to create a new email from any email
address - Thunderbird can do this over a context menu.
More information about the antlr-interest
mailing list