Compiler Design
Lexical analysis, FIRST/FOLLOW, LL(1) & LR(0)/SLR/LALR/CLR parsers, SDT & liveness analysis.
Published Study Notes & Chapters (3)
LL(1) & LR(0), SLR(1), LALR(1), CLR(1) Parsing Power & Conflicts
FIRST/FOLLOW rules, parsing hierarchy Venn relationships, state count equality between SLR(1) and LALR(1), and ambiguity.
Syntax-Directed Translation (SDT), Three-Address Code & Register Liveness
Synthesized vs Inherited attributes, S-attributed vs L-attributed SDTs, Basic Block leader identification, SSA static single assignment, and Chaitin register interference graph coloring.
Compilers 2027 Rank-Decider: Basic-Block Leaders, SSA Phi-Functions, Dominators & Graph Coloring
Exact 3-rule Basic-Block Leader algorithm, Control-Flow Dominator trees & Natural Loops, Static Single Assignment (SSA) minimal phi-nodes, backward Liveness fixpoint, and Chaitin k-coloring.
Solved Compiler Design PYQs & Practice Questions
Launch Timed Mock (12 Qs)For the grammar , is the grammar LL(1) and/or SLR(1)?
Consider a grammar that is LR(1) (CLR) and therefore unambiguous. When we merge LR(1) states sharing identical LR(0) cores to construct the LALR(1) parser, which new conflict(s) can possibly be introduced?
How many lexical tokens does a C lexical analyzer emit for the statement: printf("i = %d, &i = %x", i, &i);?
If a Context-Free Grammar is ambiguous, which of the following statements is guaranteed to be TRUE?
Which pair of bottom-up LR parsers always have the exact same number of states for any given context-free grammar?
Which of the following statements about bottom-up LR parsers is FALSE?
Consider the Syntax-Directed Definition: , and , with . Notice + (&) has higher precedence than * (#) and both are left-associative! Evaluate 2 # 3 & 5 # 4 & 1.
How many lexical tokens are produced by a standard C lexical analyzer (using Maximal Munch) on the statement: printf("i = %d, &i = %x", i, &i);?