yacc is which of the following parsers?

2025

yacc is which of the following parsers?

Answer: D. LALR ParserAnswer: 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…

  1. A.

    Predictive Parser

  2. B.

    SLR Parser

  3. C.

    CLR Parser

  4. D.

    LALR Parser

Attempted by 248 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.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…