structure Temp : TEMP = struct val anoncounter = ref 0 val namedcounter = ref 0 val tempcounter = ref 0 type label = Symbol.symbol type temp = int structure Table = IntMapTable(type key = temp fun getInt(n) = n) fun newlabel _ = (anoncounter := (!anoncounter)+1; Symbol.symbol ("L" ^ (Int.toString ((!anoncounter) - 1)))) fun namedlabel s = (namedcounter := (!namedcounter)+1; Symbol.symbol (s ^ (Int.toString ((!namedcounter) -1)))) fun makestring t = ("T" ^ (Int.toString t)) fun intern s = Symbol.symbol s fun newtemp _ = (tempcounter := (!tempcounter)+1; (!tempcounter) -1) fun tempname t = ("t" ^ Int.toString (t)) val labelname = Symbol.name end