| 1 |
= CKitLibrary |
| 2 |
|
| 3 |
The http://www.smlnj.org/doc/ckit[ckit Library] is a C front end |
| 4 |
written in SML that translates C source code (after preprocessing) |
| 5 |
into abstract syntax represented as a set of SML datatypes. The ckit |
| 6 |
Library is distributed with SML/NJ. Due to differences between SML/NJ |
| 7 |
and MLton, this library will not work out-of-the box with MLton. |
| 8 |
|
| 9 |
As of 20250523, MLton includes a port of the ckit Library synchronized |
| 10 |
with SML/NJ version 110.99.8. |
| 11 |
|
| 12 |
== Usage |
| 13 |
|
| 14 |
* You can import the ckit Library into an MLB file with: |
| 15 |
+ |
| 16 |
[options="header"] |
| 17 |
|=== |
| 18 |
|MLB file|Description |
| 19 |
|`$(SML_LIB)/ckit-lib/ckit-lib.mlb`| |
| 20 |
|=== |
| 21 |
|
| 22 |
* If you are porting a project from SML/NJ's <<CompilationManager#>> to |
| 23 |
MLton's <<MLBasis#,ML Basis system>> using `cm2mlb`, note that the |
| 24 |
following map is included by default: |
| 25 |
+ |
| 26 |
---- |
| 27 |
# ckit Library |
| 28 |
$ckit-lib.cm $(SML_LIB)/ckit-lib |
| 29 |
$ckit-lib.cm/ckit-lib.cm $(SML_LIB)/ckit-lib/ckit-lib.mlb |
| 30 |
---- |
| 31 |
+ |
| 32 |
This will automatically convert a `$/ckit-lib.cm` import in an input |
| 33 |
`.cm` file into a `$(SML_LIB)/ckit-lib/ckit-lib.mlb` import in the |
| 34 |
output `.mlb` file. |
| 35 |
|
| 36 |
== Details |
| 37 |
|
| 38 |
The following changes were made to the ckit Library, in addition to |
| 39 |
deriving the `.mlb` file from the `.cm` file: |
| 40 |
|
| 41 |
* `ast/pp/pp-ast-adornment-sig.sml` (modified): Rewrote use of `signature` in `local`. |
| 42 |
* `ast/pp/pp-ast-ext-sig.sml` (modified): Rewrote use of `signature` in `local`. |
| 43 |
* `ast/type-util-sig.sml` (modified): Rewrote use of `signature` in `local`. |
| 44 |
* `parser/parse-tree-sig.sml` (modified): Rewrote use of (sequential) `withtype` in signature. |
| 45 |
* `parser/parse-tree.sml` (modified): Rewrote use of (sequential) `withtype`. |
| 46 |
|
| 47 |
== Patch |
| 48 |
|
| 49 |
* https://github.com/MLton/mlton/blob/master/lib/ckit-lib/ckit.patch[`ckit.patch`] |