Encyclopedia > LR(1) parser

  Article Content

Canonical LR parser

Redirected from LR(1) 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
French resistance

... Operation Overlord was approaching. In the fall of 1943 COSSAC begun to direct SOE and OSS activities that were connected to the invasion plans. Eventually it took ...

 
 
 
This page was created in 28 ms