Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis15/src/compiler/low-to-tree/scope-vars.sml
ViewVC logotype

View of /branches/vis15/src/compiler/low-to-tree/scope-vars.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3847 - (download) (annotate)
Thu May 12 14:28:07 2016 UTC (3 years, 3 months ago) by jhr
File size: 822 byte(s)
  working on merge
(* scope-vars.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 *)

structure ScopeVars : sig

  (* attach local variables to the innermost block that contains their scope *)
    val assignScopes : TreeIR.block -> unit

  end = struct

    val IR = TreeIR
    val S = TreeVar.Set

  (* a rose-tree representation of the nesting of blocks *)
    datatype scope_nest = Scope of {
	blk : IR.block,			(* the block in the IR *)
	used : S.set,			(* the set of locals mentioned in the block, but not
					 * in sub-blocks)
					 *)
	inner : scope_nest list		(* nested sub-blocks *)
      }

    fun assignScopes blk = let
	  fun doBlock (IR.Block{locals, stms}, def) = let
		val
		in
		end
	  in
	  end

  end

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