Bottom-Up Parsing/Example 2: SLR(1)

From Wiki**3

< Bottom-Up Parsing
Revision as of 10:37, 2 May 2024 by Root (talk | contribs) (Problem)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Problem

Initial symbol: S

Terminals: { 0, 1, 2 }

Input: 112110

S → 1 S 1 | 1 X 0 | 2
X → 2 | S 1 | X 2

Is this an LR(0) grammar?

Describe the processing of the input by an LALR(1) parser for this grammar.

Solution