Always the case SLR and LALR have same
number of states.
While LR have more states than these two.
Because for any Bottom-up paring number of
‘CORES’ is always same while for LR() only other
thing is lookahead is different.
Theory of Computation and Compilers MCQ - Syntax Analysis
| First | Follow | |
| S | id | $ |
| R | id, E | $ |
| F | id | id, $ |
The grammar is
S → AC/CB
C → aCb/null
A → aA/a
B → Bb/b
it generate set of all strings generated by above
grammar
- A It is the position in a sentential form where the next shift or reduce operation will occur
- B It is a non-terminal whose production will be used for reduction in the next step
- C It is a production that may be used for reduction in a future step along with a position in the sentential form where the next shift or reduce operation will occur.
- D It is the production p that will be used for reduction in the next step along with a position in the sentential form where the right hand side of the production may be found
According to definition, handle is a production
rule A → β and a position in the sentential form
where string β may be found and replaced to
produce the previous right sentential form in a
rightmost derivation of sentential form.
So all are in different set.