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/varcon.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4432 - (download) (annotate)
Tue Sep 19 21:40:38 2017 UTC (2 years, 8 months ago) by jhr
File size: 1405 byte(s)
  Working on new primops.  We've moved a bunch of code from Semant to ElabData
  and we've changed the representation of primop IDs in structures.
(* varcon.sml
 *
 * COPYRIGHT (c) 2017 The Fellowship of SML/NJ (http://www.smlnj.org)
 * All rights reserved.
 *)

structure VarCon : VARCON =
struct

local structure A  = Access
      structure T  = Types
      structure S  = Symbol
      structure SP = SymPath
in

datatype var
  = VALvar of 		              (* ordinary variables *)
      {path : SP.path,
       typ : T.ty ref,
       btvs : T.tyvar list ref,
       access : A.access,
       prim : PrimopId.prim_id}
  | OVLDvar of       	      	      (* overloaded identifier *)
      {name : S.symbol,
       options: {indicator: T.ty, variant: var} list,
       scheme: T.tyfun}
  | ERRORvar                          (* error variables *)

type datacon = T.datacon                     

datatype value
  = VAL of var
  | CON of datacon

fun mkVALvar (id, acc) =
      VALvar{path = SP.SPATH [id], 
             typ = ref T.UNDEFty,
             access = acc,
	     btvs = ref [],
             prim = PrimopId.NonPrim}

val bogusCON = T.DATACON{name=S.varSymbol "bogus",
                         typ=T.WILDCARDty,
                         rep=A.CONSTANT 0,
                         const=true,
			 lazyp=false,
                         sign=A.CSIG(0,1)}

val bogusEXN = T.DATACON{name=S.varSymbol "bogus",
			 typ=BasicTypes.exnTy,
			 rep=A.CONSTANT 0,
			 const=true,
			 lazyp=false,
			 sign=A.CNIL}

end (* local *)
end (* structure VarCon *)

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