
more typnamings (>indent, ","+nam>):
   comma symbol, ->, typnamings (>indent, nam>);
more typnamings (>indent, empty>):.

typnaming (>indent, nlcr+indent+"(DefTyp "+ org + name+type+")">):
   name (name>), equals symbol,
      type (>indent+" ", type>),
        get org (org>).

%TEX
\subsection{ atomic system declarations }
%
atom declarations (>indent, decls>):
   atom symbol, atom decls (>indent, decls>).

atom decls (>indent, decl+decls>):
   atom decl (>indent, decl>), 
      more atom decls (>indent, decls>).

more atom decls (>indent, ","+decls>):
   comma symbol, ->, atom decls (>indent, decls>);
more atom decls (>indent, empty>):. 

atom decl (>indent, nlcr+indent+"(DefVal "+ org + name+ nlcr+indent+" (VType "+type+#
	nlcr+indent+"  (VAtom "+name+")))">):
   get org (org>),
   declaration (>indent+"  ", name>, type>).

%TEX
\subsection {defs}
%

def (>indent, nlcr+indent+"(DefVal "+ org + def name+ nlcr+indent+#
          " (VType "+type+body+"))">):
   def symbol, 
     get org (org>),
      declaration (>indent+"  ", def name>, type>),
      semicolon symbol,
      def body (>indent+"  ", >def name, body>).

def body (>indent, >def name, body>):
   name (def name>), rest def body (>indent, body>).

rest def body (>indent, val>):
   equals symbol, ->,  rhs (>indent, val>);
rest def body (>indent, nlcr+indent+"(VMacLambda "+farg+rest+")">):
   formal macro param (>indent+" ", farg>),
      rest def body (>indent+" ", rest>).


%TEX
 \subsection {macros}
%

mac (>indent, nlcr+indent+"(DefVal "+ org + def name+ nlcr+indent+" (VType "+type+#
     nlcr+indent+"  (VMacAlts "+ nlcr+indent+"   ["+bodies+"])))">):
   mac symbol, 
        get org (org>),
      declaration (>indent+"  ", def name>, type>),
      semicolon symbol,
      macro bodies (>indent+"    ", >def name, bodies>).

declaration (>indent, name>, type>):
   name (name>), element of symbol,
      type (>indent, type>).

macro bodies (>indent, >name, body+bodies>):
   macro body (>indent, >name, body>),
      more macro bodies (>indent, >name, bodies>).

more macro bodies (>indent, >name, ","+body+bodies>):
   semicolons, 
      macro body (>indent, >name, body>), ->,
      more macro bodies (>indent, >name, bodies>);
more macro bodies (>indent, >name, "">):.

macro body (>indent, >mac name, body>):
   name (mac name>), rest macro body (>indent, body>).

rest macro body (>indent, val>):
   equals symbol, ->,  rhs (>indent, val>);
rest macro body (>indent, nlcr+indent+"(VMacLambda "+farg+rest+")">):
   formal macro param (>indent+" ", farg>),
      rest macro body (>indent+" ", rest>).

%TEX
\subsection{ formal macro parameters }
%
formal macro params (>indent, fp+fps>):
   formal macro param (>indent, fp>), ->,
      more formal macro params (>indent, fps>);
formal macro params (>indent, "">):.

more formal macro params (>indent, ","+fp+fps>):
   comma symbol, ->,
      formal macro param (>indent, fp>),
      more formal macro params (>indent, fps>);
more formal macro params (>indent, "">):.


formal macro param (>indent, fp>):
   formal macro param1 (>indent+extra indent, fp1>),
      formal macro param tail (>indent, >fp1, extra indent>, fp>).
