Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / CKitLibrary
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>CKitLibrary</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>CKitLibrary</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p>The <a href="http://www.smlnj.org/doc/ckit">ckit Library</a> is a C front end
32 written in SML that translates C source code (after preprocessing)
33 into abstract syntax represented as a set of SML datatypes. The ckit
34 Library is distributed with SML/NJ. Due to differences between SML/NJ
35 and MLton, this library will not work out-of-the box with MLton.</p></div>
36 <div class="paragraph"><p>As of 20180119, MLton includes a port of the ckit Library synchronized
37 with SML/NJ version 110.82.</p></div>
38 </div>
39 </div>
40 <div class="sect1">
41 <h2 id="_usage">Usage</h2>
42 <div class="sectionbody">
43 <div class="ulist"><ul>
44 <li>
45 <p>
46 You can import the ckit Library into an MLB file with:
47 </p>
48 <table class="tableblock frame-all grid-all"
49 style="
50 width:100%;
51 ">
52 <col style="width:50%;">
53 <col style="width:50%;">
54 <thead>
55 <tr>
56 <th class="tableblock halign-left valign-top" >MLB file</th>
57 <th class="tableblock halign-left valign-top" >Description</th>
58 </tr>
59 </thead>
60 <tbody>
61 <tr>
62 <td class="tableblock halign-left valign-top" ><p class="tableblock"><span class="monospaced">$(SML_LIB)/ckit-lib/ckit-lib.mlb</span></p></td>
63 <td class="tableblock halign-left valign-top" ><p class="tableblock"></p></td>
64 </tr>
65 </tbody>
66 </table>
67 </li>
68 <li>
69 <p>
70 If you are porting a project from SML/NJ&#8217;s <a href="CompilationManager">CompilationManager</a> to
71 MLton&#8217;s <a href="MLBasis"> ML Basis system</a> using <span class="monospaced">cm2mlb</span>, note that the
72 following map is included by default:
73 </p>
74 <div class="listingblock">
75 <div class="content monospaced">
76 <pre># ckit Library
77 $ckit-lib.cm $(SML_LIB)/ckit-lib
78 $ckit-lib.cm/ckit-lib.cm $(SML_LIB)/ckit-lib/ckit-lib.mlb</pre>
79 </div></div>
80 <div class="paragraph"><p>This will automatically convert a <span class="monospaced">$/ckit-lib.cm</span> import in an input
81 <span class="monospaced">.cm</span> file into a <span class="monospaced">$(SML_LIB)/ckit-lib/ckit-lib.mlb</span> import in the
82 output <span class="monospaced">.mlb</span> file.</p></div>
83 </li>
84 </ul></div>
85 </div>
86 </div>
87 <div class="sect1">
88 <h2 id="_details">Details</h2>
89 <div class="sectionbody">
90 <div class="paragraph"><p>The following changes were made to the ckit Library, in addition to
91 deriving the <span class="monospaced">.mlb</span> file from the <span class="monospaced">.cm</span> file:</p></div>
92 <div class="ulist"><ul>
93 <li>
94 <p>
95 <span class="monospaced">ast/pp/pp-ast-adornment-sig.sml</span> (modified): Rewrote use of <span class="monospaced">signature</span> in <span class="monospaced">local</span>.
96 </p>
97 </li>
98 <li>
99 <p>
100 <span class="monospaced">ast/pp/pp-ast-ext-sig.sml</span> (modified): Rewrote use of <span class="monospaced">signature</span> in <span class="monospaced">local</span>.
101 </p>
102 </li>
103 <li>
104 <p>
105 <span class="monospaced">ast/type-util-sig.sml</span> (modified): Rewrote use of <span class="monospaced">signature</span> in <span class="monospaced">local</span>.
106 </p>
107 </li>
108 <li>
109 <p>
110 <span class="monospaced">parser/parse-tree-sig.sml</span> (modified): Rewrote use of (sequential) <span class="monospaced">withtype</span> in signature.
111 </p>
112 </li>
113 <li>
114 <p>
115 <span class="monospaced">parser/parse-tree.sml</span> (modified): Rewrote use of (sequential) <span class="monospaced">withtype</span>.
116 </p>
117 </li>
118 </ul></div>
119 </div>
120 </div>
121 <div class="sect1">
122 <h2 id="_patch">Patch</h2>
123 <div class="sectionbody">
124 <div class="ulist"><ul>
125 <li>
126 <p>
127 <a href="https://github.com/MLton/mlton/blob/master/lib/ckit-lib/ckit.patch"><span class="monospaced">ckit.patch</span></a>
128 </p>
129 </li>
130 </ul></div>
131 </div>
132 </div>
133 </div>
134 <div id="footnotes"><hr></div>
135 <div id="footer">
136 <div id="footer-text">
137 </div>
138 <div id="footer-badges">
139 </div>
140 </div>
141 </body>
142 </html>