


trans i num (> node, > INUM * i num) : .

trans string (> node, > STRING *string): .

trans bool (> node, > BOOL * T or F) : .

trans symbol (> node, >symbol) : trans string (> node, >symbol).

trans f num (> node, > FNUM * f num) : 
    eliminate e in float (> f num, >node).

%TEX
\section{Auxillary stuff.}
Dc syntax for numbers excludes exponents.
%

eliminate e in float(>FRACTION+"e"+exponent,>node): ->,
     exponent (>exponent, precision>, times>,>node),
     dc (>FRACTION+precision+" "+ times + " *ps.\n", new val>),
     repair (>node,>F NUM ,>new val);
eliminate e in float(>no exponent,>node):.

exponent (>"-"+num,"0">,"0."+zeros+"1">,>node): 
    zero list (>num, >empty,"0"+zeros>), ->;
exponent (>"+"+EXP,empty>,"1"+zeros>,>node):
    zero list (>EXP, >empty, zeros>), ->;
exponent (>err, empty>,empty>,>node):
    repair (>node, > FCErr,> STRING*msg), 
    where (>"*** malformed exponent: "+err, msg>).
    
zero list (>"0", >in, in>): ->;
zero list (>MINUS1 , >in, out>):
     zero list (>MINUS 1,> in+"0", out>).

EXP :: @ Exponent (x>).
FRACTION :: @ Fraction (x>).

Exponent ("0">): "00",->;
Exponent (x>):
   !0123456789! + (x>).


Fraction (x>):
   !0123456789.! + (x>).

I:: "  ".
N :: nlcr.

LIST :: "[]".
TUPLE :: "()".




dc (>expr, result>):
    talk to unix (>DC CON,>expr, result>).

trace type out (> expr ):
    type out (> expr).

init connection to dc:
     set up connection to unix (>"dc",>DC CON),
     talk to unix (>DC CON,>DC INIT,ign>).

DC INIT:: "[[True\n]P]sx\n"+
          "[[False\n]P]sy\n"+ "1p\n".


DC CON::.
MY ID :: BOX + NAME + VERSION + AUTHOR + ADDRESS + EMAIL + BOX + N.
BOX     ::  "||-----------------------------------------------------------  \n".
NAME    ::  "|| Name:    Macro Expander.                                  ||\n".
VERSION ::  
      "|| Version: 2  GLAMMAR ("+generationdate+")                        ||\n".
AUTHOR  ::  "|| Author:  Eric Voss                                        ||\n".
ADDRESS ::  "|| Address: KUN NIJMEGEN Informatica II A3017 tel: (61)2306. ||\n".
EMAIL   ::  "|| E-mail:  ericv@cs.kun.nl                                  ||\n".


layout:
	!\n\t !*  (ig>),
	comment.

comment:
	"||", ->, ^!\n! * (ign>), layout;
comment: .


%TEX
\section{Parse glass ds.} 

Scan rules as generated from {\tt fullgl.ds}  
%

scan glass ( glass>):
   	"(", white stuff, ->,scan glass ( glass>),
	")", white stuff;
scan glass (glass>):
	scan def list (>TOP,glass>).
