Operator-precedence Grammar - Operator Precedence Parsing Algorithm

Operator Precedence Parsing Algorithm

Initialize: Set ip to point to the first symbol of w$ Repeat: If $ is on the top of the stack and ip points to $ then return else Let a be the top terminal on the stack, and b the symbol pointed to by ip if a <• b or a =• b then push b onto the stack advance ip to the next input symbol else if a •> b then repeat pop the stack until the top stack terminal is related by <• to the terminal most recently popped else error end

Read more about this topic:  Operator-precedence Grammar

Famous quotes containing the word precedence:

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