[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [CoFI] CASL Concrete Syntax
Till wrote:
> Some minor points.
> ...
> page 5:
> I do not understand the syntax of TERMs and MIXED-TERMs.
> It seems that much more than wanted is allowed by the grammar.
>
> [Moreover, it is desirable to reinstate the usual productions for
> function and predicate application---and insist that they have higher
> precedence that the sequence of MIXED-TERMs, so that when a
> specification makes no use at all of mixfix applications, the
> recognized grouping of terms and atomic formulae is correct straight
> away. This should facilitate obtaining the concrete syntax of
> sublanguages that do not allow mixfix notation. I'll send the details
> in a separate message, later today. --PDM]
Here it is. Replace:
FORMULA ::= ...
| QUAL-PRED-NAME ( TERMS )
| MIXED-TERM MIXED-TERM...
| ...
TERM ::= MIXED-TERM...
MIXED-TERM ::= ...
| ( TERMS )
by:
FORMULA ::= ...
! | PRED-SYMB ( TERMS )
| SIMPLE-TERM SIMPLE-TERM...
| ...
TERM ::= SIMPLE-TERM...
SIMPLE-TERM ::= ...
! | OP-SYMB ( TERMS )
! | ( TERM )
Note that SIMPLE-TERM (was MIXED-TERM) is the subsort of TERM that
forbid mixfix applications at the outermost level; one can get the
sublanguage not allowing mixfix applications at all by replacing
"SIMPLE-TERM..." by just "SIMPLE-TERM" above, and removing the
production for FORMULA that involves SIMPLE-TERM.
The disambiguation rules are simply that "PRED-SYMB ( TERMS )" and
"OP-SYMB ( TERMS )" have higher precedence than "( TERM )".
I hope this clarifies the intended syntax. It's been prototyped in
ASF+SDF, but more with respect to accepting legal specifications than
for rejecting illegal ones. If you think it should be tightened up
further, please suggest how...
Peter
_________________________________________________________________
========= Peter D. MOSSES Associate Professor, PhD
==== ==== BRICS mailto:pdmosses@brics.dk
========= Dept. of Computer Science == pdmosses@daimi.aau.dk
==== ==== University of Aarhus http://www.brics.dk/~pdm
==== ==== Ny Munkegade, bldg. 540 Telephone: +45 8942 3364
==== ==== DK-8000 Aarhus C, Denmark Telefax: +45 8942 3255