On Tue, Feb 15, 2011 at 5:36 PM, Terence Parr <pa...@cs.usfca.edu> wrote: > Howdy. I'm thinking about revising the ref guide for ANTLR 3 (ANTLR v4 might > be awhile so I should update book). Any suggestions to improve? One obvious > thing: discuss not just java target :) > > Ter >
The thing I struggled with the most was overcoming my Lex-like expectations of the Lexer (which as I understand it is something to be addressed in Antlr4). A lot of people appear to struggle with the lexer not falling back to the last matched token if there was a partial match that didn't reach completion. The other piece of advise I had to take to heart was avoiding inline tokens in my Parser which are inserted if you have a combined grammar. I can't remember if the book or the list advised avoiding those, but specifying the lexer grammar and parser grammar separately greatly helped me overcome my incorrect assumptions (backtracking the lexer and parser are different). As virtually every example used a combined grammar, and had implicit tokens in the parser rules often, I had many problems because I didn't grok the rules about when and how to safely use implicit tokens. Once I stopped using them entirely, ANTLR became a much smoother experience. Kirby 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.