next up previous contents index
Next: 2.2 Abstract Syntax Up: 2 Rational Previous: 2 Rational

2.1 The Computer Languages Factory

external

Abstract syntax is now a traditional way of defining and representing the syntax of programming languages. It tends to give the deep structure of programs, that is in general different from the parse tree. First-order abstract syntax is commonly used in programming tools such as syntactical editors, programming environments or compilers.

To build some generic tools that manipulates programs, one must find a way to give a specification of the language in which these programs are written. This may be a table as is was the case at the beginning of the table driven syntactical editor Mentor [5], a set of primitives to create types and constructors as in the VTP (Virtual Tree Processor) [9] used by Centaur [1], or a specialized formalism that will be compiled in some way to a lower level specification as it is done by Metal [5] that was designed for Mentor and reused for Centaur, and for SDF [8].

Metal has been used with success for many years. Of course, the definition formalisms used in Centaur (Metal itself, PPML, Typol) are defined with Metal, but it has also been used for a large variety of programming languages: Pascal, ADA, Esterel, VHDL, Java, and even a commercial application of Centaur for Fortran.

However, after using Centaur for some years and listening to users it appears that some great enhancements may be achieved by redesigning the specification formalisms of Centaur. First of all, there is no complete type-checker for Metal, and that leads of course to problems that arise very late when specifying a language for Centaur, in general when using Typol to express the semantic properties of the language. Second, each formalism of the trilogy Metal/PPML/Typol has its own idea of variables and schemes. Obviously, schemes should be a sub-language common to the three formalisms. Third, type inclusion is not explicit in Metal, and that may create some problems as the intersection of two types may be unnamed. Finally, even if it is possible to run Centaur in batch mode, one wants to get some lighter implementations independent from Lisp, the implementation language of Centaur.

Some other remarks ask to rebuild the specification languages of Centaur. First, there is no modularity in Metal, and because this lack of modularity there is no abstract syntax modularity in PPML, neither in Typol. Second, there is no manner to express bindings and this means that for languages based on tex2html_wrap_inline1123 -calculi, for example, one will have to give an implementation of substitutions to express the semantic properties of these languages. Last, run-time performance is no more a problem now, or may be less important that it has been in the past. What we need is a way to perform, with a reasonable degree of safety, some quick language prototyping, taking into account semantical problems. Maintaining and reuse of specifications must also be easy.

The     Computer Languages Factory (CLF) is a set of tools and specification formalisms together with their implementations. It will be design for quick prototyping and complete implementation of computer languages, enhancing the trilogy Metal/PPML/Typol.

The following sections describe with more details some features of the first member of the CLF: AS.

external


next up previous contents index
Next: 2.2 Abstract Syntax Up: 2 Rational Previous: 2 Rational

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