Adapting Scheme-Like Macros to a C-Like Language
Kevin Atkinson
and Matthew Flatt
{kevina,
mflatt}@cs.utah.edu
University of Utah,
School of Computing
Abstract
ZL is a C++-compatible language in which high-level constructs, such
as classes, are defined using macros over a C-like core. ZL's parser
and macro expander are similar to that of Scheme. Unlike Scheme,
however, ZL must deal with C's richer syntax. Specifically, support
for context-sensitive parsing and multiple syntactic categories
(expressions, statements, types, etc.) leads to novel strategies for
parsing and macro expansion. In this paper we describe ZL's approach
to parsing and macros.
Appeared in the annual
Workshop
on Scheme and Functional Programming,
Portland, Oregon, October 2011.
The slides from the Scheme '11 presentation are also available.