Compiler technical specification


Document formatted by vherva at Fri Apr 24 11:23:22 1998 on the host schemestation. This document is produced by the SchemeStation project during the Tik-76.115 course.

  1. Introduction
  2. General
  3. Compiler
    1. Source code syntax
      1. Lexical structure
      2. Representation of datums
      3. Expressions and programs
    2. Source code semantics
    3. Primitive procedures
      1. Pairs
      2. Vectors
      3. Bit strings
      4. Messages
      5. Miscallenous
      6. Arithmetics
      7. Type predicates
    4. Macro expansion
    5. Output of the compiler
    6. Compiler command line syntax
    7. Compiler implementation
      1. The functions of module Compiler main interface
        1. File compiler-dump.scm
        2. File compiler.scm
          1. (current-build-info date builder host)
          2. (current-version-is version-string release-date)
          3. (run-compiler )
          4. (run-non-interactive-compiler command-line-args)
        3. File compile-file.scm
          1. (build-tree-from-file source)
          2. (compile-file basename)
          3. (compile-linearize-optimize tree)
          4. (compile-transform-tree! tree)
          5. (output-and-assemble sequence basename)
          6. (output-object-for-assembler object port)
          7. (reset-compiler! )
          8. (run-assembler basename)
        4. File file-input.scm
          1. (read-file file)
          2. (read-from-port input-port stream-name)
          3. (read-include-file file)
          4. (safe-open-file filename)
        5. File initial-lex-env.scm
          1. (make-initial-lexical-environment )
      2. The functions of module Compiler command line processor
        1. File myoptions.scm
        2. File options.scm
          1. (options-error . args)
          2. (process-command-line-options options-list non-switch-callback!)
          3. (register-boolean-option names callback!)
          4. (register-option-callback names num-args callback!)
    8. Scheme reader
      1. Lexical parser
      2. The functions of module Scheme reader
        1. File reader.scm
          1. (annotated-expr-annotation a-expr)
          2. (annotated-expr-expr a-expr)
          3. (make-annotated-expr expr annotation)
          4. (make-port-reader port name failure-cont)
        2. File lexer.scm
          1. (unbackslashify str)
    9. Syntax, macro expansion and semantic tree creation
      1. The functions of module Syntax, macro expansion and semantic tree creation
        1. File st-application.scm
          1. (build-st-application subtrees annotated-expr)
        2. File st-asm.scm
          1. (build-st-asm annotated-expr list-of-annotated-instructions)
          2. (build-st-asm-closure annotated-expr list-of-annotated-instructions)
        3. File st-assign.scm
          1. (build-st-assign var-tree val-tree annotated-expr)
        4. File st-aux.scm
          1. (build-st-error annotated-expr)
          2. (error-tree severity annotated-expression format-string . args)
        5. File st-closure.scm
          1. (build-st-closure variable-containers annotated-expr body-tree)
        6. File st-literal.scm
          1. (build-st-literal scheme-value annotated-expr)
        7. File st-primitive.scm
          1. (build-st-primitive-procedure procedure-specification annotated-expr)
        8. File st-sequence.scm
          1. (build-st-sequence-from-body-list body-list lex-env shadow uncond?)
        9. File st-syntax.scm
          1. (build-st-syntax syntax-procedure scheme-expr lex-env shadow uncond?)
        10. File st-test.scm
          1. (build-st-test test-tree conseq-tree altern-tree annotated-expr)
        11. File st-variable.scm
          1. (build-st-unbound-variable annotated-expr)
          2. (build-st-variable vd-container annotated-expr)
        12. File st-main-build.scm
          1. (build-st annotated-scheme-expr lex-env shadow uncond?)
          2. (build-st-top-level annotated-expr)
        13. File syntax-asm.scm
          1. (syntax-asm annotated-scheme-expr lex-env shadow uncond?)
          2. (syntax-asm-closure annotated-scheme-expr lex-env shadow uncond?)
        14. File syntax-begin.scm
          1. (syntax-begin annotated-scheme-expr lex-env shadow uncond?)
        15. File syntax-define.scm
          1. (syntax-define annotated-scheme-expr lex-env shadow uncond?)
        16. File syntax-if.scm
          1. (syntax-if annotated-scheme-expr lex-env shadow uncond?)
        17. File syntax-include.scm
          1. (syntax-include annotated-scheme-expr lex-env shadow uncond?)
        18. File syntax-lambda.scm
          1. (syntax-lambda annotated-scheme-expr lex-env shadow uncond?)
        19. File syntax-quote.scm
          1. (syntax-quote annotated-scheme-expr lex-env shadow uncond?)
        20. File syntax-set.scm
          1. (syntax-set-define annotated-scheme-expr lex-env shadow define?)
        21. File syntax-procedures.scm
          1. (make-core-syntax-frame )
        22. File macros.scm
          1. (syntax-define-syntax annotated-scheme-expr lex-env shadow uncond?)
          2. (syntax-let-syntax annotated-scheme-expr lex-env shadow uncond?)
          3. (syntax-letrec-syntax annotated-scheme-expr lex-env shadow uncond?)
    10. Code generation
      1. Semantic optimization
      2. The functions of module Code generation
        1. File lexaddrs.scm
          1. (compute-lexical-addresses! semantic-tree)
        2. File byte-code.scm
        3. File newlinearizer.scm
          1. (linearize-program-tree tree)
        4. File asm-macros.scm
        5. File core-primitives.scm
      3. The functions of module Peephole optimizer
        1. File peephole.scm
          1. (peephole-optimize! instruction-sequence)
    11. Support
      1. The functions of module Error reporting
        1. File comerror.scm
          1. (compiler-exit-on-error-function arg)
          2. (icomerr . args)
      2. The functions of module Binding environments
        1. File global-vars.scm
          1. (define-global-variable! name)
          2. (global-variable-index var-name)
          3. (implement-closed-primitive! name specs)
          4. (is-defined-global-variable? var-name)
          5. (num-global-vars )
          6. (print-global-variables-table output-port)
        2. File lexical-bindings.scm
          1. (find-lexical-binding scheme-expr lex-env)
          2. (lexical-binding-type binding)
          3. (lexical-binding-value binding)
          4. (make-lexical-binding name type value)
      3. The functions of module Semantic trees support
        1. File eval-trees.scm
        2. File trees.scm
          1. (dump-tree-to-port tree port)
          2. (make-leaf-node properties)
          3. (make-node properties subtrees)
          4. (node-properties node)
          5. (node-property node property)
          6. (node-set-subtrees! node subtrees)
          7. (node-subtrees node)
    12. Auxiliary
      1. The functions of module Formatted printing
        1. File printf.scm
          1. (pprintf port str . args)
          2. (printf str . args)
          3. (sprintf str . args)
      2. The functions of module Tracing support
        1. File trace.scm
          1. (enable-trace! tracing-mode)
          2. (trace-printf tracing-mode . args)
          3. (verbosity-printf verbosity-level . args)
  4. Assembler
    1. Assembler syntax
      1. Instruction identifiers
      2. Register identifiers
      3. Constants table
    2. Implementation
    3. Main interface
    4. Parser
    5. Labels handling
    6. Binary data generation
    7. Aux & support
  5. References

© SchemeStation project 1997-1998 [Back to the document index]