Compilers: principles, techniques, and tools
Compilers: principles, techniques, and tools
Action semantics
Compiling language definitions: the ASF+SDF compiler
ACM Transactions on Programming Languages and Systems (TOPLAS)
Internal representation of programs in GRASE
ACM SIGPLAN Notices
ACM Transactions on Programming Languages and Systems (TOPLAS)
Electronic Notes in Theoretical Computer Science (ENTCS)
Translator generation using ART
SLE'10 Proceedings of the Third international conference on Software language engineering
Delayed semantic actions in Yakker
Proceedings of the Eleventh Workshop on Language Descriptions, Tools and Applications
LDT: a language definition technique
Proceedings of the Eleventh Workshop on Language Descriptions, Tools and Applications
Hi-index | 0.00 |
Context Free Grammars (CFGs) are simple and powerful formalisms for defining languages (sets of strings) whose semantics are specified hierarchically --- the meaning of a string is determined by terminals and the meanings of substrings. This hierarchy is captured in the derivation tree corresponding to the string. Derivation trees usually contain more structure than is strictly required to determine the semantics of the string so in practice a simplified or abstract syntax tree is used as an internal representation of a concrete text. Indeed, much of the work of a compiler or source-source translator may be described in terms of stepwise transformation of such trees, culminating in a final traversal during which the translated text is output. This paper introduces Tear-Insert-Fold grammars which add tree-manipulation annotations to standard CFGs. These annotations allow typical abstract forms to be constructed directly from the grammar for the concrete syntax and provide a convenient and concise specification of the relationship between the set of derivation trees and the set of abstract trees for a parser. More significantly, for any TIF grammar Γ0 there is a TIF grammar Γ1 whose derivation trees are the abstract trees produced by Γ0.