1(*
2    Copyright (c) 2016 David C.J. Matthews
3
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License version 2.1 as published by the Free Software Foundation.
7    
8    This library is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11    Lesser General Public License for more details.
12    
13    You should have received a copy of the GNU Lesser General Public
14    License along with this library; if not, write to the Free Software
15    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16*)
17
18signature MAKESIG =
19sig
20    type env
21    type gEnv
22    type values
23    type typeConstrSet
24    type fixStatus
25    type structVals
26    type signatures
27    type functors
28    type ptProperties
29
30    type nameSpace =
31      { 
32        lookupVal:    string -> values option,
33        lookupType:   string -> typeConstrSet option,
34        lookupFix:    string -> fixStatus option,
35        lookupStruct: string -> structVals option,
36        lookupSig:    string -> signatures option,
37        lookupFunct:  string -> functors option,
38
39        enterVal:     string * values      -> unit,
40        enterType:    string * typeConstrSet -> unit,
41        enterFix:     string * fixStatus   -> unit,
42        enterStruct:  string * structVals  -> unit,
43        enterSig:     string * signatures  -> unit,
44        enterFunct:   string * functors    -> unit,
45
46        allVal:       unit -> (string*values) list,
47        allType:      unit -> (string*typeConstrSet) list,
48        allFix:       unit -> (string*fixStatus) list,
49        allStruct:    unit -> (string*structVals) list,
50        allSig:       unit -> (string*signatures) list,
51        allFunct:     unit -> (string*functors) list
52      }
53
54    type location =
55        { file: string, startLine: FixedInt.int, startPosition: FixedInt.int,
56          endLine: FixedInt.int, endPosition: FixedInt.int }
57    type exportTree = location * ptProperties list
58      
59    val compiler : nameSpace * (unit->char option) * Universal.universal list ->
60        exportTree option * ( unit ->
61           { fixes: (string * fixStatus) list, values: (string * values) list,
62             structures: (string * structVals) list, signatures: (string * signatures) list,
63             functors: (string * functors) list, types: (string * typeConstrSet) list }) option
64
65    val makeGEnv   : unit -> gEnv
66    val gEnvAsEnv  : gEnv -> env
67    val gEnvAsNameSpace: gEnv -> nameSpace
68    val useIntoEnv   : gEnv -> Universal.universal list -> string -> unit
69    val useStringIntoEnv: gEnv -> string -> unit
70    val shellProc   : gEnv -> unit -> unit    (* The command processor *)
71    
72    structure Sharing:
73    sig
74        type env = env
75        type gEnv = gEnv
76        type values = values
77        type typeConstrSet = typeConstrSet
78        type fixStatus = fixStatus
79        type structVals = structVals
80        type signatures = signatures
81        type functors = functors
82        type ptProperties = ptProperties
83    end
84end;
85