1 |
structure MkPrimPerv = struct |
functor MkPrimPervFn (structure MachDepVC: MACHDEP_VC) = struct |
2 |
|
|
3 |
|
structure E = GenericVC.Environment |
4 |
structure S = GenericVC.Source |
structure S = GenericVC.Source |
5 |
structure EM = GenericVC.ErrorMsg |
structure EM = GenericVC.ErrorMsg |
6 |
structure SM = GenericVC.SourceMap |
structure SM = GenericVC.SourceMap |
7 |
|
structure BF = MachDepVC.Binfile |
8 |
|
structure DE = GenericVC.DynamicEnv |
9 |
|
|
10 |
fun mk (gp: GeneralParams.info) specgroup = let |
fun mk (gp: GeneralParams.info) specgroup = let |
11 |
val context = AbsPath.relativeContext (AbsPath.dir specgroup) |
val context = AbsPath.relativeContext (AbsPath.dir specgroup) |
31 |
else SOME (String.tokens sep line, newpos) |
else SOME (String.tokens sep line, newpos) |
32 |
end |
end |
33 |
|
|
34 |
|
local |
35 |
val boguspid = GenericVC.PersStamps.fromBytes |
val boguspid = GenericVC.PersStamps.fromBytes |
36 |
(Byte.stringToBytes "0123456789abcdef") |
(Byte.stringToBytes "0123456789abcdef") |
37 |
|
in |
38 |
fun bogus n = { name = n, env = GenericVC.Environment.emptyEnv, |
fun bogus n = { name = n, env = GenericVC.Environment.emptyEnv, |
39 |
pidInfo = { statpid = boguspid, sympid = boguspid, |
pidInfo = { statpid = boguspid, sympid = boguspid, |
40 |
ctxt = GenericVC.CMStaticEnv.empty } } |
ctxt = GenericVC.CMStaticEnv.empty } } |
41 |
|
end |
42 |
|
|
43 |
fun loop (split, m, fl, pos) = |
fun loop (split, m, fl, pos) = |
44 |
case lineIn pos of |
case lineIn pos of |
68 |
TextIO.closeOut s |
TextIO.closeOut s |
69 |
end |
end |
70 |
|
|
71 |
fun compile (name, file, args) = Dummy.f () |
fun compile (name, file, args) = let |
72 |
|
fun one (arg, e) = E.layerEnv (#env (look arg), e) |
73 |
|
val ctxt = foldl one E.emptyEnv args |
74 |
|
val bfc = Dummy.f () |
75 |
|
val pi = { statpid = BF.staticPidOf bfc, |
76 |
|
sympid = BF.lambdaPidOf bfc, |
77 |
|
ctxt = E.staticPart ctxt } |
78 |
|
val env = E.mkenv { static = BF.senvOf bfc, |
79 |
|
symbolic = BF.symenvOf bfc, |
80 |
|
dynamic = DE.empty } |
81 |
|
val pspec = { name = name, env = env, pidInfo = pi } |
82 |
|
in |
83 |
|
StringMap.insert (m, name, pspec) |
84 |
|
end |
85 |
in |
in |
86 |
case line of |
case line of |
87 |
[] => loop (split, m, fl, newpos) |
[] => loop (split, m, fl, newpos) |