Hi all,
while I familiarize myself with ANTLR to translate from one high-level
language to another, I wasn't able to find a good starting point showing
how to pass-through stuff from the input stream to templates.
Can someone give me a little hint? I'm using the latest version of
ANTLR to generate ASTs for an input stream. With the latest version of
StringTemplate I'm generating code from the AST using templates.
Concretely, I must retain stuff of the input stream in the following
situations:
1) Single line comments must be kept while parsing
2) Multi line comments must also be kept but have to be converted
into
Single line comments
3) If a parsing error occurred, the complete sentence of the input
stream (which produces the error) must passed into the AST to
write it into the resulting code. Moreover, ANTLR must continue
parsing when running into this situation.
I've already found Terence article at [1] but I'm not sure whether
this is
the best way under ANTLR3. As I'm writing comment into the hidden
channel,
it would be great to deal with this channels rather than modifying
ANTLR.
Is there a sophisticated solution for my three problems?
Thank you very much in advance.
Kind regards,
Chris Sekszczynska
Student of computer engineering
at University of Applied Sciences Bremen, Germany
[1]
http://www.antlr.org/article/preserving.token.order/preserving.token.order.tml
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---