next up previous contents index
Next: 4 User's Manual Up: 3 Tutorial Previous: 3.6 Formalism Inclusion

3.7 Formalism Extension

external

Suppose   that we have already defined an abstract syntax and possibly some semantics for a computer language. Even if a standard have been accepted for this language, it will certainly be the case that some compilers accept some proprietary features, for example ``tag'' and ``exit'' statements to provide easy error recovery or exceptions. To take this extension into account, we want to inherit most of what have been done for the standard version of the language.

abstract syntax of L_Best_Inc
  extends L with

tag, exit : Id # Exp -> Statement;

end L_Best_Inc;

This definition will create a new formalism tailored for the Best Inc. compiler. This formalism is different from the initial one. A procedure will be provided to coerce L programs into L_Best_inc ones, and L_Best_inc programs that do not make use of the tag and exit statements into L programs.

AS does not implement formalism   restriction. However this can be easily simulated with formalism extension.

external Extension of a Formalism

external


next up previous contents index
Next: 4 User's Manual Up: 3 Tutorial Previous: 3.6 Formalism Inclusion

Thierry Despeyroux
Fri May 16 15:24:06 MET DST 1997