[antlr-interest] new book organization question

Terence Parr parrt at cs.usfca.edu
Wed Aug 20 11:50:21 PDT 2008


On Aug 19, 2008, at 11:48 PM, Dennis Benzinger wrote:
>> I. Introduction
>>  basic architectures, describe application categories,
>>  introduce language implementation ideas.
>>
>> II. Generators (before readers because it's easier to understand)
>>
>> III. Readers (parsing, introduces all of the intermediate data
>> structures too)
>> [...]
>
> I'd prefer to have the Readers part before the Generators part. You
> first have to parse something before you can generate something out of
> it.

Well,That was an interesting paradox I had to solve. basically, I  
realized that explaining how to print out "3.152e-13" is much easier  
than explaining how to recognize it properly. but, how can I talk  
about generators without talking about readers first. It turns out, we  
can do lots of things. The examples I chose include object to  
relational mapping (uses reflection) and a vector math to postscript  
translator that turns the printer into a vector math interpreter. At  
first, I have a set of handbuilt objects to represent operations. A  
GUI or something else could easily build these without resorting to a  
reader. Then I morph that into more of a standard tree structure and  
show how to use templates and so on to generate the appropriate  
postscript.

Then when I do readers, it will start to fall into place. :) Do you  
think that will work?

> And because you wrote that "each part will use techniques and
> patterns identified in the previous parts" I find it quite confusing  
> to
> have Readers after Generators.

Agreed if you look just at the table of contents. You think my  
approach will work as explained above?

> Does the Readers part build upon
> Generators?

Well, In fact it does the reader section now knows what its target is:  
trees. :) It provides the goal before the thing that can create those  
data structures.

Ter


More information about the antlr-interest mailing list