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:

[CHANGED:] At the level of architectural specifications, ambiguities of grouping in unit terms are resolved in the same way as for structured specifications. Moreover, a SPEC-NAME occurring as a UNIT-SPEC gives rise to just the SPEC-NAME itself in the abstract syntax tree, rather than a UNIT-TYPE with an empty list SPEC* of argument specifications. [] 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-v1.0 -- Version: 1.0 -- 22 October 1998.
Comments to

Prev Up Next