Grammar Based Definition Of Metaprogramming Systems Program-Transformation.Org: The Program Transformation Wiki Robert Cameron? and Robert Ito?. Grammar-Based Definition of Metaprogramming Systems. ACM Transactions on Programming Languages and Systems Vol. 6, No. 1, January 1984, Pages 20-54. (ACM Digital Library) Summary This paper describes the GRAMPS method for meta-programming. GRAMPS stands for GRAmmar-based MetaProgramming Scheme. The method basically describes how abstract syntax tree? manipulation can be done in a general-purpose programming language. Given an API for analyzing and constructing syntax trees, transformations can be expressed.
EXTENSIBLE PARSING & TRANSFORMATION We present the metafront tool for specifying flexible, safe, and efficient syntactic transformations between languages defined by context-free grammars. The transformations are guaranteed to terminate and to map grammatically legal input to grammatically legal output. We rely on a novel parser algorithm, specificity parsing, that is designed to support gradual extensions of a grammar by allowing productions to remain in a natural style and by statically reporting ambiguities and errors in terms of individual productions as they are being added. Our tool may be used as a parser generator in which the resulting parser automatically supports a flexible, safe, and efficient macro processor, or as an extensible lightweight compiler generator for domain-specific languages. We show substantial examples of both kinds.