CADiZ

Reference manual / Non-standard extensions / Mixfix injections in free types


Within free type paragraphs, injections are traditionally written using \ldata and \rdata brackets. The name of an injection can be a functional operator. CADiZ permits such injections to be written using the mixfix syntax of an application. For example (ignoring overloading of existing Z symbols)...

function 103 (_ N)
function 101 leftassoc (_ + _)
function 101 leftassoc (_ - _)
function 102 leftassoc (_ * _)
function 102 leftassoc (_ / _)

term ::= \arithmos N
       | \arithmos + \arithmos
       | \arithmos - \arithmos
       | \arithmos * \arithmos
       | \arithmos / \arithmos

The effect of this on the concrete syntax is to redefine Branch as follows, where the second production covers both the new syntax of injections and the old syntax of elements.

Branch = DeclName , \ldata , Expression , \rdata
| Expression
;

IT 4-Jan-2002