[antlr-interest] book examples list

Terence Parr parrt at cs.usfca.edu
Wed Aug 20 13:58:47 PDT 2008


Hi, I have either build or in planning on building the following  
examples for the book in order to demonstrate all the patterns and  
principles.  Comments?

Ter

INTRO / INFORMAL SOLUTIONS
Processing comma-separated values using ANTLR
Processing comma-separated values using Python
Processing comma-separated values with newlines in quoted data elements
Processing comma-separated value files from the shell
Processing log files

GENERATOR
Generating Object-Relational Database Mappings Using Templates
Generating Object-Relational Database Mappings
Using Postscript Printers As Virtual Machines (vector math example)
Generating Postscript with Tree Grammars
Generating Postscript using Homogeneous tree nodes

READER
Fig: A generic configuration file reader
Building a generic bytecode assembler
Reading XML files

SEMANTIC ANALYSIS
A Symbol Table for C
A Symbol Table for a subset of Java
Detecting uninitialized variable references

INTERPRETER
Bytecode interpreter
Tree-based Interpreter (will need a reader building ASTs)
An efficient buffer for manipulating strings (Like TokenRewriteStream)
Some "internal" interpreter using Ruby

TRANSLATOR
Wiki to HTML
Generating class hierarchy diagrams
Building a source code pretty printer
	Wow...this turns out to be extremely difficult!
Building a simple compiler
Adding closures to a Java-like language
Differentiating polynomials using ANTLRMorph


More information about the antlr-interest mailing list