Encyclopedia > Canonical LR parser

  Article Content

Canonical LR parser

A canonical LR parser or LR(1) parser is an LR parser whose parsing tables are constructed in a similar way as with LR(0) parsers except that the items in the item sets also contain a follow, i.e., a terminal that is expected by the parser after the right-hand side of the rule. Such an item for a rule A -> BC is for example of the form
A -> B · C, a
which would mean that the parser has read a string corresponding to B and expects next a string corresponding to C followed by the terminal 'a'. LR(1) parsers can deal with a very large class of grammars but their parsing tables are often very big. This can often be solved by merging item sets if they are identical except for the follows, which results in socalled LALR parsers.

Constructing LR(1) parsing tables

... yet to be written ...



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Kuru Kuru Kururin

... task difficult. The player controls the direction and speed of movement (it's a 3-speed stick). Gameplay is very challenging and rewarding, and once the player has gotten ...

 
 
 
This page was created in 33.3 ms