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

2.3 Isolating Abstract Syntax from Concrete Syntax

external

For many years (and even now), a computer language was mainly defined by its concrete syntax, and this concrete syntax was supposed to be unique. This is the reason why in Metal the abstract syntax and the concrete syntax of a computer language was given in a unique specification. However, experiments with the Centaur system show that it is very often useful to have several concrete representations for the same program. In Centaur this may be achieved by specifying several pretty-printers for the same language. But until now, there is still a unique parser for each formalism.

There is no good reason for this asymmetry, but to be able to specify multiple parsers for one formalism, one has to separate the definition of the abstract syntax, that must be unique, from the definitions of the concrete syntaxes.

This option may appear opposite to what is done in SDF [8] or Syn [2]. One of the goals of SDF+ASF is to give the possibility to express semantical properties of a computer language using its concrete syntax. This is why it seems reasonable to generate the abstract syntax from the concrete one in this context. When more than one concrete syntax exists for a unique computer language, this method of hiding the abstract syntax to the user cannot be used anymore. It should be possible to see the abstract syntax definition (even if it has been generated by some mean) and to reuse it for an alternate concrete syntax.

external


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

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