
TOP::"TOP".
LOC::"LOC".

scan def (>level, out>):
   	"(", white stuff, ->,scan def (>level, out>),
	")", white stuff;
scan def (>level, def node>):
	"DefVal", white stuff, ->,
	scan orig (valorig>),
        scan symbol (defval>),
        where (>defval,STRING*name>),
        scan val (body>),
        where (>body, VType*vttype*valas>),
        where (> DefVal * valorig * defval * body, def node>),
        macro def atom (>level,>def node, >name, >valas);
scan def (>level, DefCon * conorig * defcon * conas>):
	"DefCon", white stuff,
	scan orig (conorig>),
	scan val (defcon>),
	scan val (conas>), ->;
scan def (>level, DefTyp * typorig * deftyp * typas>):
	"DefTyp", white stuff,
	scan orig (typorig>),
	scan symbol (deftyp>),
        where (>deftyp,STRING*name>),
        top level (> level,>name),
	scan typ (typas>).

scan typ ( out>):
   	"(", white stuff, ->,scan typ ( out>),
	")", white stuff;
scan typ ( TypAtom * atomnm>):
	"TypAtom", white stuff,
	scan symbol (atomnm>), ->;
scan typ ( TypFun * funpar * funres>):
	"TypFun", white stuff,
	scan typ (funpar>),
	scan typ (funres>), ->;
scan typ ( TypIn * ityp>):
	"TypIn", white stuff,
	scan typ (ityp>), ->;
scan typ ( TypOut * otyp>):
	"TypOut", white stuff,
	scan typ (otyp>), ->;
scan typ ( TypUni * uityp * uotyp>):
	"TypUni", white stuff,
	scan typ (uityp>),
	scan typ (uotyp>), ->;
scan typ ( TypNon * nontyp>):
	"TypNon", white stuff,
	scan typ (nontyp>), ->;
scan typ ( PTInt>):
	"TypInt", white stuff, ->;
scan typ ( PTFlo>):
	"TypFlo", white stuff, ->;
scan typ ( PTStr>):
	"TypString", white stuff, ->;
scan typ ( PTBool>):
	"TypBool", white stuff, ->;
scan typ ( TypAppset>):
	"TypAppset", white stuff, ->;
scan typ ( TypPwr * pwrtyp * pwrval>):
	"TypPwr", white stuff,
	scan typ (pwrtyp>),
	scan val (pwrval>), ->;
scan typ ( TypProd * ptypes>):
	"TypProd", white stuff,
	scan typ list (ptypes>), ->;
scan typ ( TypStar * startyp>):
	"TypStar", white stuff,
	scan typ (startyp>), ->;
scan typ ( TypLocal * locsyms * loctyp>):
	"TypLocal", white stuff,
	scan symbol list (locsyms>),
	scan typ (loctyp>), ->;
scan typ ( TypSym * sym>):
	"TypSym", white stuff,
	scan symbol (sym>), ->;
scan typ ( TypBind * boundname>):
	"TypBind", white stuff,
	scan symbol (boundname>).

scan val ( out>):
   	"(", white stuff, ->,scan val ( out>),
	")", white stuff;
scan val ( VValApply * avval * avpar>):
	"VValApply", white stuff,
	scan val (avval>),
	scan val (avpar>), ->;
scan val ( VSym * symorig * sym>):
	"VSym", white stuff,
	scan orig (symorig>),
	scan symbol (sym>), ->;
scan val ( VInt * i>):
	"VInt", white stuff,
	scan inum (i>), ->;
scan val ( VFlo * f>):
	"VFlo", white stuff,
	scan fnum (f>), ->;
scan val ( VStr * s>):
	"VStr", white stuff,
	scan string (s>), ->;
scan val ( VBool * b>):
	"VBool", white stuff,
	scan bool (b>), ->;
scan val ( VType * vttyp * vtval>):
	"VType", white stuff,
	scan typ (vttyp>),
	scan val (vtval>), ->;
scan val ( VSysLambda * slpar * slval>):
	"VSysLambda", white stuff,
	scan fp (slpar>),
	scan val (slval>), ->;
scan val ( VSysSigma * sspar * ssval>):
	"VSysSigma", white stuff,
	scan fp (sspar>),
	scan val (ssval>), ->;
scan val ( VSysApply * asval * aspar>):
	"VSysApply", white stuff,
	scan val (asval>),
	scan val (aspar>), ->;
scan val ( VWhere * wdefs * wval>):
	"VWhere", white stuff,
	scan def list (>LOC, wdefs>),
	scan val (wval>), ->;
scan val ( VList * l>):
	"VList", white stuff,
	scan val list (l>), ->;
scan val ( VAppset * aps>):
	"VAppset", white stuff,
	scan val list (aps>), ->;
scan val ( VAtom * atomnm>):
	"VAtom", white stuff,
	scan symbol (atomnm>), ->;
scan val ( VSyn * synlist>):
	"VSyn", white stuff,
	scan val list (synlist>), ->;
scan val ( VMacAlts * alts>):
	"VMacAlts", white stuff,
	scan val list (alts>), ->;
scan val ( VMacLambda * mpar * mval>):
	"VMacLambda", white stuff,
	scan fp (mpar>),
	scan val (mval>), ->;
scan val ( VBuiltin * oper * args>):
	"VBuiltin", white stuff,
	scan string (oper>),
	scan val list (args>).
