Joint work with Chris Wolff.
My purpose is just to provide a high-quality SML'97 front end for supporting whole-program compilation. The provided example framework does not have support for separate compilation.
There is a SML/NJ .cm file that compiles the 110.42 parser and elaborator under 110.42. The .cm file for the elaborator is a bit bloated, and could do with some shaking. See here for code.
There is a program that extracts the interfaces for the Standard ML basis library (as used in SML/NJ 110.42) and produces a file that can be read in to initialize the static environment for use with the elaborator library. See here for code. There is some info on running the code in the header of DumpEnv.sml
Here is the new and modified SML/NJ code used in the elaborator to SML'97 code
(removing some SML/NJ extensions).
The resulting code compiles under MLton.
It does not compile under SML/NJ since I use the Basis Library version
of the IntInf structure.
See here for code.
The .cm file is here.
Chris Wolff has modified Pattern Match Compilation from Absyn to Absyn. The SML/NJ compiler performs match compilation simultaneously with translation to FLINT. Here is a .cm file to be used in the src/compiler directory.
The modified / extra code for the match compiler is
here for code to
go into the src/coElabMainmpiler/Cwolff directory.
ElabMain.elabMain (SOME filename) just runs the elaborator.
PEMain.PEMain (SOME filename) runs the elaborator and the match compiler.
TransMain was used in our testing:
TransMain.transMain (SOME filename, true) runs the elaborator and
match compiler, translating the result of the match compiler into
FLINT.
TransMain.transMain (SOME filename, false) performs a translation into
FLINT without previously running the match compiler.