Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/compiler/ElabData/syntax/absynutil.sml
ViewVC logotype

View of /sml/trunk/compiler/ElabData/syntax/absynutil.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2162 - (download) (annotate)
Thu Nov 2 21:20:47 2006 UTC (13 years, 8 months ago) by blume
File size: 769 byte(s)
eliminated src dir
(* absynutil.sml
 *
 * (C) 2001 Lucent Technologies, Bell Labs
 *
 * More stuff from ElabUtil should be moved here eventually.
 *)
structure AbsynUtil : sig

    val unitExp : Absyn.exp

    val TUPLEexp : Absyn.exp list -> Absyn.exp
    val TUPLEpat : Absyn.pat list -> Absyn.pat

end = struct

    val unitExp = Absyn.RECORDexp []

    fun TUPLEexp l = let
	fun build (_, []) = []
	  | build (i, e :: es) =
	    (Absyn.LABEL { number = i-1, name = Tuples.numlabel i }, e)
	    :: build (i+1, es)
    in
	Absyn.RECORDexp (build (1, l))
    end

    fun TUPLEpat l = let
	fun build (_, []) = []
	  | build (i, e :: es) = (Tuples.numlabel i, e) :: build (i+1, es)
    in
	Absyn.RECORDpat { fields = build (1, l), flex = false,
			  typ = ref Types.UNDEFty }
    end
end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0