The Mjølner System: Fragment System

The fragment system is used for splitting BETA programs into smaller pieces (fragments). The fragment system is responsible for the dependencies between different fragment files, defining a given library or program. Due to the generality of the fragment system, a BETA program can be divided into smaller pieces in many different ways:
Modularization
Programs can be split into modules of logically related elements, called fragments. A fragment is not restricted to a specific BETA element such as a pattern. A fragment may e.g. contain one or more patterns, a set of attributes of a pattern, or the imperative bodies of one or more procedure patterns.
Separation of interface and implementation
A fragment can be split into interface fragments and implementation fragments. It is thus possible to hide the implementation details of a fragment from the client fragments using the fragment.
Alternative implementations and variant control
It is possible to have alternative implementations of a fragment. Such alternative fragments may be machine dependent and used for organizing different variants of the same fragment.
Configuration control
The system automatically combines the necessary fragments needed for a complete program. This includes selection of machine dependent fragments. The system handles organization of code for different machines.
Units for separate compilation
A fragment may be separately compiled. The compiler makes an automatic dependency analysis on the fragment structure. When fragments have been changed, the system keeps track of dependent fragments that must be recompiled.
Grammar based
The fragment system is grammar based in the sense that a fragment is a legal sequence of terminal and nonterminal symbols of the grammar. The fragment system may thus be used to implement a fragment structure for any language, based on its context-free syntax.
Metaprogramming
The fragment system is part of the metaprogramming system Yggdrasil, and enables the management and manipulation of coherent BETA programs located in different files.

More Information

For further information see
MIA 99-42: The Fragment System: Further Specification