Johannes Luber wrote: > PAREXPR is a imaginary token, adding semantics to otherwise > indiscriminable situations or just some additional clarity like in this > case. The "-> ^()" is a tree rewrite operator, saying that the created > AST should look differently than the original input. I suppose your > problem with the tree walker is that it doesn't recognize all > possibilities created by the parser. Unless the missing alternatives are > somehow covered in the Identifier and literal rules, try I appreciated for this information. > primaryExpression > : THIS > | Identifier > | literal > | arrayLiteral > | objectLiteral > | ^( PAREXPR expression ) > ; I'm not sure, but I think, it worked! Thanks a lot. But I had to add "backtrack=true" options because of LL(*) conflicts. I said "I think, it worked", because I don't know exactly that it worked. The treewalker didn't give me an error, but I didn't look at the tree yet that it is correct or not. Now I try to learn using the parser and the treewalker. > In general, look at the documentation about ASTs to learn more about them. > > Johannes I'm studying now how the parser and tree walker works. After that I want to learn ANTLR grammar and the other things from the book (I haven't buy it, but I'll)
Thanks for helping. This gives me more desire to learn compilers and antlr. Fatih Tolga Ata 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 -~----------~----~----~----~------~----~------~--~---
