SML# Document Version 4.0.0
32 The SML# Source Distribution Package

32.3 compiler directory

The compiler directory is divided into sub-directory, as shown.

  • Directories

    • compilePhases/ : compilation phases

      bitmapcompilation/ explicit layout-bitmap generation
      cconvcompile/ type-directed calling-convention generation
      closureconversion/ closure conversion
      datatypecompilation/ datalayout computation
      elaborate/ syntactic elaboration
      fficompilation/ C interface generation for higher-order functions
      llvmemit/ llvm code emission
      llvmgen/
      loadfile/
      machinecodegen/ law-level code generation
      main/
      matchcompilation/ pattern matching compilation
      nameevaluation/ name evaluation and module compilation
      parser/ parser
      recordcalcoptimization/ typed record calculus optimization
      recordcompilation/ type-directed record compilation
      stackallocation/ stack frame allocation
      toplevel/
      typedcalcoptimization/ typed intermediate language optimization
      typedelaboration/
      typeinference/ type definition,uncurry optimization
      valrecoptimization/ mutual recursive function optimization
    • compilerIRs/ : compiler intermediate representations

      absyn/ Abstract syntax tree
      anormal/ A-normal forms
      bitmapcalc/ the language with explicit layout bitmap
      closurecalc/ the language with explicit closure allocation
      idcalc/ the language without static scoping
      llvmir/ LLVM IR
      machinecode/ the register transfer language
      patterncalc/ the untyped intermediate language
      recordcalc/ the polymorphic record calculus
      runtimecalc/ the language with runtime types
      typedcalc/ the typed intermediate language
      typedlambda/ the typed lambda calculus
    • data/ : types, constants and other data

      builtin/ compiler built-in data
      constantterm/ constants
      control/ parameters controlling compiler function
      name/ runtime code labels
      runtimetypes/ runtime types
      symbols/ representation of variables, labels etc
      types/ type representations
    • extensions/ : various compile functions

      concurrencysupport/ concurrent thread support
      debug/ debugging support
      foreach/ massively parallel _foreach statement support
      format-utils/ formater library for smlformat
      json/ JSON manipulation support
      reflection/ compile-time reflection support
      usererror/ compiler error handling
      userlevelprimitive/ compiler extension via user code
    • libs/ : libraries used by the compiler

      digest/& SHA hashing library
      env/ dictionary utilities
      heapdump/ heap image dump function
      ids/ counter utilities
      interactivePrinter/ interactive printers
      list-utils/ list utilities
      toolchain/ UNIX toolchain commands
      util/ miscellaneous utility functions
  • Files

    minismlsharp.smi the interface file of minismlshap
    minismlsharp.sml the top-level of the compiler to compile smlsharp
    smlsharp.smi the interface file of smlsharp
    smlsharp.sml smlsharp top-level

Each of directories, including compiler sub-directories, contains the main sub-directory, where the source files are located. For example, the source files for abstract syntax trees are placed in compilerIRs/absyn/main/. Source files include program files with .sml suffix and the corresponding interface files of the same names with .smi suffix.

Files with following suffix are input files of source file generation tools.

.ppg an input file to smlformat pretty-printer generator.
.grm an smlyacc input file
.lex an smlyacc input file

An interface file having of one of those names with .smi suffix describes the interface of the generated source program.