Wednesday, August 18, 2004

Output grammars 

Terence Parr - University of San Francisco
Most programs that emit source code or other text output are unstructured blobs of generation logic interspersed with print statements. The primary reason is the lack of suitable tools and formalisms. The proper formalism is that of an output grammar because you are not generating random characters--you are generating sentences in an output language. This is analogous to using a grammar to describe the structure of input sentences. Rather than building a parser by hand, most programmers will use a parser generator. Similarly, we need some form of "unparser generator" to generate text.

Links to this post:


Comments: Post a Comment

This page is powered by Blogger. Isn't yours?