generalized hierarchical data structure over statements
authorhaftmann
Wed Sep 01 12:27:49 2010 +0200 (2010-09-01)
changeset 390178cd5b6d688fa
parent 38971 5d49165a192e
child 39018 5681d7cfabce
generalized hierarchical data structure over statements
src/Tools/Code/code_namespace.ML
     1.1 --- a/src/Tools/Code/code_namespace.ML	Wed Sep 01 12:01:44 2010 +0200
     1.2 +++ b/src/Tools/Code/code_namespace.ML	Wed Sep 01 12:27:49 2010 +0200
     1.3 @@ -6,17 +6,17 @@
     1.4  
     1.5  signature CODE_NAMESPACE =
     1.6  sig
     1.7 -  datatype 'a node =
     1.8 +  datatype ('a, 'b) node =
     1.9        Dummy
    1.10 -    | Stmt of Code_Thingol.stmt
    1.11 -    | Module of ('a * (string * 'a node) Graph.T);
    1.12 +    | Stmt of 'a
    1.13 +    | Module of ('b * (string * ('a, 'b) node) Graph.T);
    1.14    val hierarchical_program: (string -> string) -> { module_alias: string -> string option,
    1.15 -    reserved: Name.context, empty_nsp: 'b, namify_module: string -> 'b -> string * 'b,
    1.16 -    namify_stmt: Code_Thingol.stmt -> string -> 'b -> string * 'b,
    1.17 -    cyclic_modules: bool, empty_data: 'a, memorize_data: string -> 'a -> 'a }
    1.18 +    reserved: Name.context, empty_nsp: 'a, namify_module: string -> 'a -> string * 'a,
    1.19 +    namify_stmt: Code_Thingol.stmt -> string -> 'a -> string * 'a,
    1.20 +    cyclic_modules: bool, empty_data: 'b, memorize_data: string -> 'b -> 'b }
    1.21        -> Code_Thingol.program
    1.22        -> { deresolver: string list -> string -> string,
    1.23 -           hierarchical_program: (string * 'a node) Graph.T }
    1.24 +           hierarchical_program: (string * (Code_Thingol.stmt, 'b) node) Graph.T }
    1.25  end;
    1.26  
    1.27  structure Code_Namespace : CODE_NAMESPACE =
    1.28 @@ -24,10 +24,10 @@
    1.29  
    1.30  (* hierarchical program structure *)
    1.31  
    1.32 -datatype 'a node =
    1.33 +datatype ('a, 'b) node =
    1.34      Dummy
    1.35 -  | Stmt of Code_Thingol.stmt
    1.36 -  | Module of ('a * (string * 'a node) Graph.T);
    1.37 +  | Stmt of 'a
    1.38 +  | Module of ('b * (string * ('a, 'b) node) Graph.T);
    1.39  
    1.40  fun hierarchical_program labelled_name { module_alias, reserved, empty_nsp,
    1.41        namify_module, namify_stmt, cyclic_modules, empty_data, memorize_data } program =