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:

    Let not England forget her precedence of teaching nations how to live.
    John Milton (1608–1674)

    Mark the babe
    Not long accustomed to this breathing world;
    One that hath barely learned to shape a smile,
    Though yet irrational of soul, to grasp
    With tiny finger—to let fall a tear;
    And, as the heavy cloud of sleep dissolves,
    To stretch his limbs, bemocking, as might seem,
    The outward functions of intelligent man.
    William Wordsworth (1770–1850)