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