Compiler Design — Solved PYQ & Mock Arena
Topic-wise Compiler Design previous-year GATE & UGC NET questions with step-by-step LaTeX solutions
In Static Single Assignment (SSA) intermediate representation, what is the exact role of a -function such as placed at the entry of a join basic block?
Consider the Three-Address Code fragment below:
1: i = 1
2: s = 0
3: if i > 10 goto 8
4: if i % 2 == 0 goto 6
5: s = s + i
6: i = i + 1
7: goto 3
8: return s
How many Basic Blocks exist in its Control Flow Graph?
Consider the Syntax-Directed Definition: , and , with . Notice + (&) has higher precedence than * (#) and both are left-associative! Evaluate 2 # 3 & 5 # 4 & 1.
For the grammar , is the grammar LL(1) and/or SLR(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);?
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?
In global register allocation via Chaitin’s algorithm, finding the minimum number of CPU registers needed for live variables without spilling reduces directly to:
How many lexical tokens does a C lexical analyzer emit for the statement: printf("i = %d, &i = %x", i, &i);?
In an L-Attributed Syntax-Directed Definition for production , an inherited attribute of symbol may depend on:
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?