The best paper I ever read on compilers is dated 1964
"META II a syntax-oriented compiler writing language" by Val Schorre.
(http://doi.acm.org/10.1145/800257.808896)
In 10 pages, he shows you how to build an astoundingly simple but
very effective compiler-compiler, provides
you with with the compiler-compiler grammar and provides you with enough
details for you to hand implement it in an afternoon (with one astonishing
conceptual moment when you realize how it recurses), and just for grins implements an
ALGOL-like language. The paper is a complete gas and really should
be required reading for anybody working with compiler technology.
Here's a link to play with an great tutorial on metacompiling,
based on the paper.
http://www.bayfronttechnologies.com/mc_tutorial.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…