Prev Up Next
Go backward to C.2 Context-Free Syntax
Go up to C Concrete Syntax
Go forward to C.4 Lexical Syntax

C.3 Disambiguation

The given grammar for input syntax is quite ambiguous. This section provides some precedence rules for disambiguation. Note that the syntax for atomic formulae and terms caters for use of mixfix notation when applying predicates and operations; however, the recognition of the exact applicative structure of these constructs is left unspecified here, since it is inherently context-dependent.

At the level of structured specifications, ambiguities of grouping are resolved as follows:

Within a FORMULA, the use of prefix and infix notation for the logical connectives gives rise to some potential ambiguities. These are resolved as follows:

The declaration of infix, prefix, postfix, and general mixfix operation symbols may introduce further potential ambiguities, which are partially resolved as follows (remaining ambiguities have to be eliminated by explicit use of grouping parentheses in terms, or by use of parsing annotations):

Various other techniques for allowing the omission of grouping parentheses and/or list-separators in input (and display) are familiar from previous specification and programming languages, e.g., user-specified precedence (relative or absolute), and the "offside" rule. Moreover, not all parsers are expected to implement full mixfix notation. CASL is therefore to allow parsing annotations on (libraries of) specifications, to indicate the possible omission of grouping parentheses, and the degree of use of mixfix notation. Such annotations are expected to apply uniformly to CASL sublanguages, and to most extensions.


CoFI Document: CASL/Summary --Version 0.99-- 21 April 1998.
Comments to cofi-language@brics.dk

Prev Up Next