ANTLR attributes introduction
05 Mar 2012, 15:38
trevor smith (1 post)
Great book,really can’t say how informative and clearly written it is.
One suggestion so far. Starting on page 54 in chapter 3 you use ANTLR attributes in the book examples. They aren’t introduced until chapter 6. The reader s left trying to parse what amounts to a forward reference to an entire language they don’t know.
Worse, no acknowledgement of the fact is made, something along the lines of “ the code you see after each rule is a special combination of Java and special syntax and characters that is specific to ANTLR and which we’ll learn about in chapter 6, for now just try to get the general idea of what the code does by reading the embedded Java expressions”
Actually, that specific wording is not all that great since it,s not really possible to do that. What is really needed is an English translation above each line of what the code does, especially since the point of the chapter seems to be to introduce the flow of control that can be created by following rules with actions. It seems like knowing what the section does is an important part of that. Otherwise, it amounts to the reader saying, “and then something interesting happens “ in place of each action.
I don’t know about other readers but when I am following closely and I encounter unknown symbols and phrases that are central to what’s being explained I stop reading and try to find what I missed or look forward a few pages or begin to wonder if I am lacking some pre req for the book.
I want to update this to say that there are some comments in the code above the lines I mentioned, but really, they’re a little cryptic also.
This is not meant to detract from a great book , one that I highly recommend to anyone wanting to advance their skill set.
07 Mar 2012, 03:23
Terence Parr (34 posts)
I’m glad that you are enjoying the book.
Sorry about the for reference and chapter 3. I probably should have put a reference that you can click on to jump to the definitions in chapter 6. Chap 3 is the quick tour for the impatient so it really was not meant to be complete.
|You must be logged in to comment|