From: "Loring Craymer" <[email protected]> > This is the sort of problem that can be solved with lexer modes. ANTLR 3 > does > not support lexer modes, however, so the usual approach is two phase > parsing, > where the first pass would parse text outside of [ ] but recognizes [ > ... ] > constructs as single tokens. The second pass processes the text inside of > braces. Not pretty, but it works. Trying to implement something which > requires > feedback between parser and lexer is a bad idea, even if you can get it to > work: > the resulting grammars will be very fragile. > > --Loring
Hello Loring. I was just about to implement my scheme when I realized just what you are saying. The approach you suggest does seem a lot easier. I figured I can use semantic actions at each rule to build an expression tree of my own classes. Then I can build a special node that handles the "inner" grammar of variable rules ([xxx]). Sounds reasonable to me, at the moment anyway. Thank you for your suggestion! Daniel 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.
