MetaCedarDoc.tioga
Michael Plass, June 21, 1990 1:56 pm PDT
META CEDAR
PCEDAR2.0 — FOR INTERNAL XEROX USE ONLY
MetaCedar
Michael Plass
© Copyright 1985, 1987, 1988, 1990 Xerox Corporation. All rights reserved.
Abstract: MetaCedar allows the use of Cedar as a meta-language for generating Cedar code, sort of a poor-man's macro expander. It is most useful for unrolling loops and such.
Created by: Michael Plass
Maintained by: Michael Plass <Plass.pa>
Keywords: hack, macro
XEROX Xerox Corporation
Palo Alto Research Center
3333 Coyote Hill Road
Palo Alto, California 94304
For Internal Xerox Use Only
MetaCedar foo
Reads the file foo.meta and writes foo.mesa. The input file looks like a cedar-mesa file, except that things within placeholder brackets () and after ampersands are treated specially. The code within placeholders is executed at pre-processor time. The identifiers after ampersands are treated as meta-variables, and are evaluated at pre-processor time (i.e., &s is short for PutInt[s], where PutInt is a procedure supplied by MetaCedar at pre-processor time). Identifiers after percent signs (i.e., %s) are treated similarly, except that the meta-variable should be of type ROPE. A question mark denotes a meta-procedure (macro) call; the arguments should be enclosed in brackets and separated by commas, e.g., ?Apply[a,13]. The arguments must be balanced in ({[]}), and are turned into ropes (with expansion of the % and & meta-variables) and passed to the meta-procedure. The arguments to macro calls (currently) may not contain other macro calls.
The output is indented according to some simple rules. Try
% MetaCedar MetaTest
for an example.
MetaCedar is released primarily for the use of one package, FontTune. It has also proven to be useful for generating a software rasterop for PCedar.