LR parsing is one type of bottom up parsing. It is used to parse the large class of grammars.
"L" stands for left-to-right scanning of the input, "R" stands for constructing a right most derivation in reverse
SLR parser refers to simple LR Parsing. It is same as LR(0) parsing. The only difference is in the parsing table.To construct SLR (1) parsing table, we use canonical collection of LR (0) item.
In the SLR (1) parsing, we place the reduce move only in the follow of left hand side.
CLR refers to canonical lookahead. CLR parsing use the canonical collection of LR (1) items to build the CLR (1) parsing table. CLR (1) parsing table produces the more number of states as compare to the SLR (1) parsing.
In the CLR (1), we place the reduce node only in the lookahead symbols.
LALR refers to the lookahead LR. To construct the LALR (1) parsing table, we use the canonical collection of LR (1) items.
In the LALR (1) parsing, the LR (1) items which have same productions but different look ahead are combined to form a single set of items
Parser is mainly classified into 2 categories: Top-down Parser, and Bottom-up Parser.
Top-down parser is the parser which generates parse for the given input string with the help of grammar productions by expanding the non-terminals i.e. it starts from the start symbol and ends on the terminals. It uses left most derivation.
Bottom-up Parser is the parser which generates the parse tree for the given input string with the help of grammar productions by compressing the non-terminals i.e. it starts from non-terminals and ends on the stat symbol. It uses reverse of the right most derivation.
LR(0) ⊂ SLR(1) ⊂ LALR(1) ⊂ CLR(1)
Please fill out the quick form and we will be in touch with lightening speed.