Should I file this issue as a bug? I think antlr should rather display
error message in this case (when -debug is used) that debugging
TreeRewriters is not yet supported instead of generating parser
extending non existing class DebugTreeRewriter?!

2011/11/11 Eric [via ANTLR] <[email protected]>:
> On Fri, Nov 11, 2011 at 12:24 PM, Eric <[hidden email]> wrote:
>
>>
>>
>> On Fri, Nov 11, 2011 at 12:12 PM, Piotr Sobczyk <[hidden email]>wrote:
>>
>>> Thanks, Eric but did you read my question carefully? I have no
>>> problems with debugging a plain TreeGrammar and I know how to do it.
>>> My problems occur when I add output = AST and filter = true options to
>>> that grammar. Then the generated parser can't be even compiled by
>>> javac. You can copy-paste my minimal example, generate a parser from
>>> it and then try to compile the parser to see exactly what the problem
>>> is.
>>>
>>> 2011/11/11 Eric <[hidden email]>:
>>>
>>
>> Thanks for pointing that out. My mistake.
>>
>> I don't have an answer to that as I have never tryied that. If I find a
>> way to do it or can verify that it can't be done I will post something.
>>
>> Thanks, Eric
>>
>>
>>
>>
>>> >
>>> >
>>> > On Fri, Nov 11, 2011 at 6:47 AM, piotr.sobczyk <[hidden email]
>>> >
>>> > wrote:
>>> >>
>>> >> This is a very minimal example of something called TreeRewriter in
>>> Antlr:
>>> >>
>>> >> tree grammar Test;
>>> >>
>>> >> options {
>>> >>    ASTLabelType = CommonTree;
>>> >>    output = AST;
>>> >>    filter = true;
>>> >> }
>>> >>
>>> >> tokens {
>>> >> TEST;
>>> >> }
>>> >>
>>> >> test
>>> >>    :
>>> >>    ^(TEST .) -> ^(TEST)
>>> >>    ;
>>> >>
>>> >> The important chunks are options: output = AST and filter = true.
>>> >> These
>>> >> two
>>> >> combined together make a TreeRewriter (this is a class name that
>>> generated
>>> >> parser extends).
>>> >>
>>> >> Now please compile it with -debug flag like that:
>>> >>
>>> >> java -cp antlr-3.3-complete.jar org.antlr.Tool -debug Test.g
>>> >>
>>> >> What is generated in my case is a class defined like this:
>>> >>
>>> >> public class MyTreeRewriter extends DebugTreeRewriter{
>>> >>
>>> >> And here the problems start. There is no class DebugTreeRewriter
>>> defined
>>> >> in
>>> >> Antlr jar so I'm getting a compilation error. Moreover when I googled
>>> >> DebugTreeRewriter I didn't found any single trace of such class
>>> existence!
>>> >>
>>> >> I'm getting a lot more compilation errors because it seems generated
>>> class
>>> >> assumes that it inherited a lot of members from DebugTreeRewriter and
>>> they
>>> >> obviously can't be found.
>>> >>
>>> >> I'm starting to be suspicious that there is not support for debugging
>>> tree
>>> >> rewriters at all so far. Can someone confirm/deny this? Did anyone
>>> >> succeeded
>>> >> to debug a tree rewriter?
>>> >
>>> >
>>> > Yes.
>>> >
>>> > See http://www.antlr.org/wiki/pages/viewpage.action?pageId=4554901
>>> >
>>> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>>
>>> http://antlr.1301665.n2.nabble.com/Is-it-possible-to-debug-tree-rewriters-grammars-translating-AST-to-AST-tp6985126p6985126.html
>>> >> Sent from the ANTLR mailing list archive at Nabble.com.
>>> >>
>>> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> >> Unsubscribe:
>>> >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>> >
>>> >
>>>
>>
>>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://antlr.1301665.n2.nabble.com/Is-it-possible-to-debug-tree-rewriters-grammars-translating-AST-to-AST-tp6985126p6986144.html
> To unsubscribe from Is it possible to debug tree rewriters (grammars
> translating AST to AST)?, click here.
> See how NAML generates this email


--
View this message in context: 
http://antlr.1301665.n2.nabble.com/Is-it-possible-to-debug-tree-rewriters-grammars-translating-AST-to-AST-tp6985126p6991792.html
Sent from the ANTLR mailing list archive at Nabble.com.

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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.

Reply via email to