Haskell-report, chapter 3 - Expressions

Simon Marlow simonmar@microsoft.com
Thu, 28 Aug 2003 14:53:42 +0100


=20
> I do not completely understand the first part of chapter 3 of the=20
> Haskell-report.
> Concretely I am stumbling about the notation of nonterminals=20
> indexed by=20
> their precedence
> level. This should be a number ranging from 0 to 9. But what=20
> about this exp^{10} production rule?

The grammar is written using a kind of macro syntax, such that you can
obtain the full grammar by expanding each of the rules for nonterminals
with a superscript 'i' for each 'i' in the range 0 to 9.  These rules
then cover the grammar for expressions containing infix operators with
precedences between 0 and 9.

The '10' in the 'exp10' nonterminal doesn't refer to the precedence of
an operator, it is there purely as a clue to to the reader that these
expressions bind tighter than all the infix operators.  Hope this helps.

Cheers,
	Simon