M6(VI) 11/15/72 M6(VI)
NAME
m6 - general purpose macro processor
SYNOPSIS
m6 [ -d arg1 ] [ arg2 [ arg3 ] ]
DESCRIPTION
M6 takes input from file arg2 (or standard input if arg2 is
missing) and places output on file arg3 (or standard
output). A working file of definitions, ``m.def'', is
initialized from file arg1 if that is supplied. M6 differs
from the standard [1] in these respects:
#trace:, #source: and #end: are not defined.
#meta,arg1,arg2: transfers the role of metacharacter arg1 to
character arg2. If two metacharacters become identical
thereby, the outcome of further processing is not
guaranteed. For example, to make [ ]{} play the roles of
#:<> type
\#meta,<\#>,[:
[meta,<:>,]:
[meta,[substr,<<>>,1,1;,{]
[meta,[substr,{{>>,2,1;,}]
#del,arg1: deletes the definition of macro arg1.
#save: and #rest: save and restore the definition table
together with the current metacharacters on file m.def.
#def,arg1,arg2,arg3: works as in the standard with the
extension that an integer may be supplied to arg3 to cause
the new macro to perform the action of a specified builtin
before its replacement text is evaluated. Thus all builtins
except #def: can be retrieved even after deletion. Codes
for arg3 are:
0 - no function
1,2,3,4,5,6 - gt,eq,ge,lt,ne,le
7,8 - seq,sne
9,10,11,12,13 - add,sub,mpy,div,exp
20 - if
21,22 - def,copy
23 - meta
24 - size
25 - substr
26,27 - go,gobk
28 - del
29 - dnl
30,31 - save,rest
FILES
m.def working file of definitions
/usr/lang/mdir/m6a m6 processor proper (/usr/bin/m6 is
only an initializer)
/usr/lang/mdir/m6b default initialization for m.def
/bin/cp used for copying initial value of m.def
SEE ALSO
[1] A. D. Hall, The M6 Macroprocessor, Bell Telephone
Laboratories, 1969
DIAGNOSTICS
``err'' - a bug, an unknown builtin or a bad definition
table
``oprd''-can't open input or initial definitions
``opwr''-can't open output
``ova'' - overflow of nested arguments
``ovc'' - overflow of calls
``ovd'' - overflow of definitions
``Try again'' - no process available for copying m.def
AUTHOR
M. D. McIlroy
BUGS
Characters in internal tables are stored one per word. They
really should be packed to improve capacity. For want of
space (and because of unpacked formats) no file arguments
have been provided to #save: or #rest:, and no check is made
on the actual opening of file m.def. Again to save space,
garbage collection makes calls on #save: and #rest: and so
overwrites m.def.
Since the program is written in the defunct language B it is
currently unavailable. Expressions of interest may make a C
version appear.