The Community for Technology Leaders
RSS Icon
Subscribe
Big Island, HI, USA
Jan. 6, 2003 to Jan. 9, 2003
ISBN: 0-7695-1874-5
pp: 324b
Adam Granicz , California Institute of Technology
ABSTRACT
<p>This paper describes a practical approach for implementing domain-specific languages with extensible compilers. Given a compiler with one or more front-end languages, we introduce the idea of a "generic" front-end that allows the syntactic and semantic specification of domain-specific languages. Phobos, our generic front-end, offers modular language specification, allowing the programmer to define new syntax and semantics incrementally.</p> <p>A key feature of our approach is the use of an open term language that can be used to describe arbitrary syntax, and the use of a term rewriting engine to encode semantic ac-tions. The term language is expressive. Scoping can be defined explicitly, and term rewrites use second-order substitution, allowing the use of higher-order abstract syntax if needed.</p> <p>Given a language specification and a source string, the generic front-end constructs a push-down automaton (PDA) based on the supplied grammar, lexes the source string, and simulates the constructed PDA with the stream of tokens obtained. During parsing, rewrite rules associated with grammar productions are executed, producing a single term when the PDA accepts. This term is then converted via further rewriting into a compiler representation and compilation proceeds to generate executable code.</p>
INDEX TERMS
null
CITATION
Adam Granicz, "Phobos: A Front-End Approach to Extensible Compilers", HICSS, 2003, 36th Hawaii International Conference on Systems Sciences, 36th Hawaii International Conference on Systems Sciences 2003, pp. 324b, doi:10.1109/HICSS.2003.1174890
27 ms
(Ver 2.0)

Marketing Automation Platform Marketing Automation Tool