Prev Up Next
Go backward to 2.7.4 Precedence and Gathering
Go up to 2.7 Parsing, Bubbles and Meta-Parsing
Go forward to 2.7.6 Tokens, Bubbles and Metaparsing

2.7.5 Default Precedence and Gathering

This section sketches the rules used by Maude to generate the default precedence values and gathering patterns for operators; they are entirely similar to those used by OBJ3 [27]. These values will be associated to those operators for which the user does not specify this information as part of the operator declaration.

The rules for the assignment of default precedence values are:

The rules for the generation of the default gathering patterns are:

To illustrate these rules, we show below the default precedence and gathering patterns generated by Maude for the module BINARY-NAT presented in Section 2.7.2.

  op 0 : -> Bit .
  op 1 : -> Bit .
  op nil : -> Bits .
  op __ : Bits Bits -> Bits [assoc id: nil prec 41 gather (e E)] .
  op |_| : Bits -> MachineInt [prec 0 gather (&)] .
  op normalize : Bits -> Bits .
  op _+_ : Bits Bits -> Bits [assoc comm prec 41 gather (e E)] .
  op _*_ : Bits Bits -> Bits [assoc comm prec 41 gather (e E)] .
  op _^_ : Bits Bits -> Bits [prec 41 gather (E E)] .
  op _>_ : Bits Bits -> Bool [prec 41 gather (E E)] .
  op _?_:_ : Bool Bits Bits -> Bits [prec 41 gather (E & E)] .
  op not_ : Bits -> Bits [prec 15 gather (E)] .

Prev Up Next