The KoalaCompiler is developed as a component-based system using StrategoXT:

  • The system is implemented as a set of program transformation tools.
  • Different pieces are implemented as separate tool components (executable programs).
  • Each tool component is implemented in the Stratego programming language.
  • Tool components are connected through the ATerm exchange format.
  • All tool components are syntax-driven:
    • Syntax definitions are defined in SDF.
    • From a syntax definition a pretty-printer, abstract syntax definition, and libraries are generated.
    • All transformations operate on abstract syntax trees .
  • Compositions of tool components are created with the Transformation Tool Composition framework XTC.

The Koala compilation process consists of three phases:

  1. Parsing. During this phase a top-level Koala component definition is located and parsed. Subseuently, all contained elements are recursively located parsed. The result of parsing is a single abstract syntax tree (AST) that contains exactly all elements of the Koala composition.
  2. Normalization. In this phase the AST from phase 1 is reduced to normal form. This involves several simplification steps, constant propagation, function inlining, reachability analysis, switch reduction, transitive wiring, and component pruning. The result is again an AST, that may serve for analysis or realization.
  3. Realization. In this phase the normalized Koala composition is realized for some target. Traditionally, realization is only performed for the C programming language (which we support through KoalaC). Other realizations are: pretty-printing (see KoalaText) or vizualization (see KoalaDot). Additional realization components can simply be connected to the compiler framework (e.g., see KoalaSTC).

-- MerijnDeJonge - 22 Dec 2004

Revision: r1.1 - 22 Dec 2004 - 12:59 - MerijnDeJonge
Tools > KoalaCompiler > HowToKoalaCompilerFramework
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback