MLton

The ckit Library is a C front end written in SML that translates C source code (after preprocessing) into abstract syntax represented as a set of SML datatypes. The ckit Library is distributed with SML/NJ. Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton.

As of 20230526, MLton includes a port of the ckit Library synchronized with SML/NJ version 110.99.3.

Usage

  • You can import the ckit Library into an MLB file with:

    MLB file Description

    $(SML_LIB)/ckit-lib/ckit-lib.mlb

  • If you are porting a project from SML/NJ’s CompilationManager to MLton’s ML Basis system using cm2mlb, note that the following map is included by default:

    # ckit Library
    $ckit-lib.cm                            $(SML_LIB)/ckit-lib
    $ckit-lib.cm/ckit-lib.cm                $(SML_LIB)/ckit-lib/ckit-lib.mlb

    This will automatically convert a $/ckit-lib.cm import in an input .cm file into a $(SML_LIB)/ckit-lib/ckit-lib.mlb import in the output .mlb file.

Details

The following changes were made to the ckit Library, in addition to deriving the .mlb file from the .cm file:

  • ast/pp/pp-ast-adornment-sig.sml (modified): Rewrote use of signature in local.

  • ast/pp/pp-ast-ext-sig.sml (modified): Rewrote use of signature in local.

  • ast/type-util-sig.sml (modified): Rewrote use of signature in local.

  • parser/parse-tree-sig.sml (modified): Rewrote use of (sequential) withtype in signature.

  • parser/parse-tree.sml (modified): Rewrote use of (sequential) withtype.

Patch