diff options
Diffstat (limited to 'driver.fun')
-rw-r--r-- | driver.fun | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -1,5 +1,6 @@ -functor Driver(P: PARSER): DRIVER = struct - structure P = P +functor Driver(E: EMIT): DRIVER = struct + structure I = E.I + structure P = E.I.P datatype execMode = Normal | DebugE | DebugT @@ -56,17 +57,19 @@ functor Driver(P: PARSER): DRIVER = struct fun collect ctx = let - val result = P.parseDef ctx + val (continue, ctx) = P.parseDef ctx in - case result of - NONE => () - | SOME (def, ctx) => ( - P.printDef def; + if continue then collect ctx - ) + else + P.finalize ctx end + + val parseCtx = collect parseCtx + val progInfo = P.explode parseCtx + val ilCtx = I.createCtx progInfo in - collect parseCtx + E.emit "/tmp/prog.s" ilCtx end | DebugT => P.P.T.debugPrint file | DebugE => P.P.debugPrint file (#includeDirs config) |