[il-antlr-interest: 32743] [antlr-interest] AST rewrite

2011-06-11 Thread srinivasan karthikeyan pitchai
Hi Gurus, I'm a novice using ANTLR for a development project. I am at a stage where I need to rewrite AST so that the transformed AST renders itself more easy for me to walk and emit the translation that I need. In this context I've a concept question. In general, can I use the *same* tree

[il-antlr-interest: 32745] Re: [antlr-interest] AST rewrite

2011-06-11 Thread Trevor John Thompson
The short answer is yes, you can manipulate the tree (before walking, not during). I am using tree adapter manipulations to reorganize the AST, and then handing the tree to the standard tree walker. The only caution is that TreeIterator depends on parent pointers. I am contemplating a version

[il-antlr-interest: 32746] Re: [antlr-interest] Extract all rules/lexems/keywords of a Language.g into XML format?

2011-06-11 Thread Ruslan Zasukhin
On 6/11/11 3:16 AM, Terence Parr pa...@cs.usfca.edu wrote: Hi Terrence, Hi. Let me be more specific...I am going to serialize entire grammar as an augmented transition network into any generated parser or lexer. This will improve your recovery and error messages. There will be an API to

[il-antlr-interest: 32747] Re: [antlr-interest] Extract all rules/lexems/keywords of a Language.g into XML format?

2011-06-11 Thread Terence Parr
On Jun 11, 2011, at 7:40 AM, Ruslan Zasukhin wrote: On 6/11/11 3:16 AM, Terence Parr pa...@cs.usfca.edu wrote: Hi Terrence, Hi. Let me be more specific...I am going to serialize entire grammar as an augmented transition network into any generated parser or lexer. This will improve your

[il-antlr-interest: 32748] Re: [antlr-interest] AST rewrite

2011-06-11 Thread srinivasan karthikeyan pitchai
Thanks for sharing your input. I am able to do some pretty complex AST manipulation as stated initially. First results are very encouraging, I am getting an end to end translation successfully. Regards, Vasan On 6/11/2011 7:31 PM, Trevor John Thompson wrote: The short answer is yes, you

[il-antlr-interest: 32749] [antlr-interest] Comments in Tcl - Lexer

2011-06-11 Thread dmp
Hello, I'm working with Antlr to provide syntax highlight for Tcl (in Netbeans). I have a problem with COMMENT token. Basic version for one line comment looks like this: COMMENT : '#' (options {greedy=false;} : .)* NEWLINE ; But comment in Tcl starts only at the beginning of a line with