# LR parsing

Again freestudy9 comes with a new topic related to LR parsing. Additionally, we have pointed to point information about it.

- LR parsing most efficient method of bottom-up parsing which used to parse large class of context-free grammar.
- The technique called LR(k) parsing; the “L” is for a left to right scanning of the input symbol,
- The “R” for constructing rightmost derivation in reverse. the k for the number of derivation input symbols of lookahead that used in making parsing decision.
- So, There are three types of LR parsing, types

1. SLR (Simple LR)

2. CLR (Canonical LR)

3. LALR (Lookahead LR) - The schematic form of LR parser given in figure 3.1.6.
- The structure of input buffer for storing the input string, a stack for storing a grammar symbols. Output and a parsing table comprised of two parts, namely action, and goto Properties of LR parser
- So LR parser constructed to recognize most of the programming language for which CFG written.
- The class of grammars that parsed by LR parser is a superset of a class of grammars. That parsed using predictive parsers.
- LR parser works using a non-backtracking shift-reduce technique.
- LR parser can detect a syntactic error as soon as possible.

**Some Basic Terms**

1. Augmented grammar: If grammar G having start symbol S then augmented grammar the new grammar G’ in which S’ is a new start symbol such that S’ -> .S> .S.

2. Kernel items: It is a collection of items S’ .S and all the items whose dots are not at the S’->.S left the most end of the RHS of the rule.

3. Non-Kernel items: It a collection of items in which dots at the leftmost end of that RHS of the rule.

4. Variable prefix: It is a set of the prefix in right sentential form of the production A α, this settA-> can appear on the stack during the shift-reduce action.

**Related Search**

Compiler Design, Next-Use Information, Role of Parser, Free Study.

## Leave a Reply