[antlr-interest] soliciting language recipes book outline feedback
Terence Parr
parrt at cs.usfca.edu
Mon Dec 31 13:52:02 PST 2007
Howdy folks,
I've signed up to do another book for pragmatic programmers. This
time I'm going to do a collection of "how to" examples/recipes. The
book is meant to teach you how to fish not give you fish--the examples
will be necessarily smallish. I anticipate the level being
introductory through intermediate as real, big examples will simply
not fit. I'd like to start out with really brain-dead examples such as
comma separated value parsing so that I can explain the fundamentals.
I will always remember the first technical book I read (on 6502
assembly code code by Lance Levanthal). This awesome book started out
showing how to clear a memory location. This gave me the confidence
that I might actually understand the rest of the book :)
I propose breaking the book up into three main sections: parsing,
interpretation, translation. I would love to hear peoples feedback
about what examples would be useful and exciting. Keep in mind that
the average example will need to fit in about 5 to 10 pages. Code
samples will be made available online and not necessarily completely
printed out in the book to save space. Also I would love to hear your
feedback about how the recipes should be laid out or described.
Please CC Susannah Pfalzer, with whom I'm fortunate to work with
again, on your replies as she is not a member of this list. :)
Here is my rough draft list of examples, which is a bit too few.
Thanks and happy new year!
Ter
------------
I. Parsing recipes
comma-separated values (show in java then python or ruby then ANTLR)
parsing binary data (fixed and non-fixed size records)
parsing log files (in awk/sed/grep then ANTLR)
configuration file or JSON or YAML
text-based network protocol (e.g., POP, nntp, http)
graphs and networks via edge list format
read fixed a XML format like:
SVG (vector graphics)
or, RDF ontology graph
handling include files
parsing island grammars like JSP
simplified English imperative statement recognizer
(E.g., games: "pick up gun and shoot spy")
II. Interpretation recipes
arithmetic expression trees
polynomial differentiation
query language (parse and pull data from DB)
serial/deserialize objects
partial PS interpreter
simple programming language interpreter
III. Translation recipes
wiki to HTML
simplified programming language pretty printer
instrumenting simplified programming language with profiling info
simple Java byte code generator
simple robot control language for lego MindStorm robots
class hierarchy generator (awk/sed/grep then grep+ANTLR)
generates DOT format for graphviz to visualize
More information about the antlr-interest
mailing list