yacc is which of the following parsers?
2025
yacc is which of the following parsers?
- A.
Predictive Parser
- B.
SLR Parser
- C.
CLR Parser
- D.
LALR Parser
Attempted by 118 students.
Show answer & explanation
Correct answer: D
Answer: yacc is an LALR(1) parser.
Explanation: yacc is a parser generator that produces bottom-up parsers using the LALR(1) technique (Look-Ahead LR with one token of lookahead).
Predictive (LL) parsers are top-down and work differently from yacc's bottom-up, shift/reduce approach.
SLR is a simpler bottom-up method; LALR(1) is generally more powerful than SLR because it uses more lookahead information.
CLR (canonical LR(1)) is the full LR(1) method with larger tables. LALR(1) merges compatible LR(1) states to produce more compact tables while keeping most of the LR(1) power.
A video solution is available for this question — log in and enroll to watch it.