Operator-precedence Grammar - Precedence Functions

Precedence Functions

An operator precedence parser usually does not store the precedence table with the relations, which can get rather large. Instead, precedence functions f and g are defined. They map terminal symbols to integers, and so the precedence relations between the symbols are implemented by numerical comparison: f(a) < g(b) must hold if a <• b holds, etc.

Not every table of precedence relations has precedence functions, but in practice for most grammars such functions can be designed.

Read more about this topic:  Operator-precedence Grammar

Famous quotes containing the words precedence and/or functions:

    It is difficult to separate the tapestry
    From the room or loom which takes precedence over it.
    John Ashbery (b. 1927)

    Empirical science is apt to cloud the sight, and, by the very knowledge of functions and processes, to bereave the student of the manly contemplation of the whole.
    Ralph Waldo Emerson (1803–1882)