M6(VI)                       2/19/74                       M6(VI)







NAME

     m6 - general purpose macroprocessor



SYNOPSIS

     m6 [ name ]



DESCRIPTION

     M6 copies the standard input to the  standard  output,  with

     substitutions  for any macro calls that appear.  When a file

     name argument  is  given,  that  file  is  read  before  the

     standard input.



     The processor is as described in the  reference  with  these

     exceptions:



       #def,arg1,arg2,arg3: causes arg1 to become  a  macro  with

       defining  text  arg2 and (optional) built-in serial number

       arg3.



       #del,arg1: deletes the definition of macro arg1.



       #end: is not implemented.



       #list,arg1: sends the name of the macro designated by arg1

       to  the  current  destination  without  recognition of any

       warning characters;  arg1  is  1  for  the  most  recently

       defined macro, 2 for the next most recent, and so on.  The

       name is taken to be empty when arg1 doesn't make sense.



       #warn,arg1,arg2: replaces the old warning  character  arg1

       by the new warning character arg2.



       #quote,arg1: sends the definition text of  macro  arg1  to

       the current destination without recognition of any warning

       characters.



       #serial,arg1:  delivers   the   built-in   serial   number

       associated with macro arg1.



       #source,arg1: is not implemented.



       #trace,arg1: with arg1 = `1' causes  a  reconstruction  of

       each later call to be placed on the standard output with a

       call level number; other values of arg1 turn tracing off.



     The built-in `warn' may  be  used  to  replace  inconvenient

     warning  characters.  The example below replaces `#' `:' `<'

     `>' by `[' `]' `{' `}'.



               #warn,<#>,[:

               [warn,<:>,]:

               [warn,[substr,<<>>,1,1;,{]

               [warn,[substr,{{>>,2,1;,}]

               [now,{calls look like this}]



     Every built-in function has a serial number, which specifies

     the  action  to  be  performed  before  the defining text is

     expanded.  The serial numbers are: 1 gt, 2 eq, 3 ge, 4 lt, 5

     ne,  6  le,  7 seq, 8 sne, 9 add, 10 sub, 11 mpy, 12 div, 13

     exp, 20 if, 21 def, 22 copy, 23 warn, 24 size, 25 substr, 26

     go,  27  gobk, 28 del, 29 dnl, 32 quote, 33 serial, 34 list,

     35 trace.  Serial number 0 specifies no built-in action.



SEE ALSO

     A. D. Hall, M6 Reference Manual.  Computer Science Technical

     Report #2, Bell Laboratories, 1969.



DIAGNOSTICS

     Various table overflows and ``impossible'' conditions result

     in  comment  and  dump.  There are no diagnostics for poorly

     formed input.



AUTHOR

     M. D. McIlroy



BUGS

     Provision should be made to extend tables as needed, instead

     of  wasting  a  big fixed core allocation.  You get what the

     PDP11 gives you for arithmetic.