Compiler Design Unit 2 Notes AKTU (BCS602)

AKTU · BTECH · Semester 6 · Compiler Design · Unit 2 · Notes

AKTU Compiler Design (BCS602) Unit 2 notes for B.Tech Semester 6 – Basic Parsing Techniques and Automatic Construction of Efficient Parsers. Topics…

Open the interactive reader to study this resource on AcademicArk.

Unit 2: Basic Parsing Techniques and Automatic Construction of Efficient Parsers – AKTU syllabus topics

  • Parsers
  • Shift-Reduce Parsing
  • Operator-Precedence Parsing
  • Top-Down Parsing
  • Predictive Parsers
  • LR Parsers
  • Canonical Collection of LR(0) Items
  • Construction of SLR Parsing Tables
  • Construction of Canonical LR Parsing Tables
  • Construction of LALR Parsing Tables
  • Using Ambiguous Grammars
  • Automatic Parser Generator
  • Implementation of LR Parsing Tables

Most asked AKTU PYQ questions from Unit 2

  1. Q2b. For the grammar S→aAd |bBd |aBe |bAe, A→f, B→f Construct LR(1) Parsing table. Also draw the LALR table. (10 marks, 2023-24)
  2. Q4a. Check whether the given grammar is LR(0) or not: S→PQy, P→Sy|x, Q→yS. (10 marks, 2023-24)
  3. Q4a. Check whether the given grammar is LR(0) or not: S→PQy, P→Sy|x, Q→yS (10 marks, 2020-21)
  4. Q3b. For the grammar S→aAd |bBd |aBe |bAe A→f, B→f Construct LR(1) Parsing table .also draw the LALR table from the derived LR(1) parsing table. (10 marks, 2017-18)
  5. Q3. Consider the following grammar S-AS|b A-SA|a. Construct the SLR parse table for the grammar. Show the actions of the parser for the input string “abab”. (15 marks, 2016-17)
  6. Q4b. Consider the following grammar for a simple expression language: E → E + T | T T → T * F | F F → ( E ) | id Consider expression id * (id+id).Apply shift reduce parsing to construct parse tree. (10 marks, 2023-24)
  7. Q2b. Illustrate the problems associated with top-down parsing. Consider some examples to explain how these problems can be resolved. (10 marks, 2023-24)
  8. Q4a. Construct parsing table for the following grammar using LALR parser: S -> CC C -> aC | b (10 marks, 2023-24)
  9. Q4b. Verify that the following grammar is LL (1) S -> AaAb | BbBa A -> ε B -> ε (10 marks, 2023-24)
  10. Q3a. Construct the CLR parse table for the following Grammar: A→BB B→ cB B→d (10 marks, 2022-23)

AKTU paper codes: BCS602

Other Compiler Design units

Compiler Design previous year papers

More versions of this resource

Browse all notes · Semester 6 notes · Compiler Design notes