CSC365 Compiler Design and Construction

Compiler Design and Construction: most repeated questions

Questions that have come up in more than one paper, matched by what they ask rather than exact wording. Most repeated first.

  1. 6×Asked in 2081, 2080, 2076, 2075
    Construct the LL(1) parsing table for the following grammar. S → AS1 C A → 0 C → 2C εAnswer coming5
    See the wording in each paper
  2. 3×Asked in 2081, 2080
    Compute the FIRST and FOLLOW of all the non terminals in following grammar. S → AB A → 0A' 1A' ε A' → SSA' ε B → AS 1Answer coming5
    See the wording in each paper
  3. 2×Asked in 2081
    Define core item. Compute the LR(1) item sets for the following grammar: S → AA A → aA ∣ bAnswer coming10
    See the wording in each paper
  4. 2×Asked in 2076, 2075
    Define Syntax directed definition. Construct annotated parse tree for the input expression (5 3+2) 5 according to the following syntax directed definition. [figure in the original paper]Answer coming
    See the wording in each paper
  5. 2×Asked in 2081
    Describe the synthesized attribute and inherited attribute with an example.Answer coming10
    See the wording in each paper
  6. 2×Asked in 2076, 2075
    Write Syntax Directed Definition to carry out type checking for the following expression. E id E1 op E2 E1 relop E2 E1[E2] E1 ↑Answer coming
    See the wording in each paper
  7. 2×Asked in 2076, 2075
    Discuss about the different factors affecting target code generation.Answer coming
    See the wording in each paper
  8. 2×Asked in 2080, 2076
    Why code optimization is needed? Describe any two techniques for loop optimization.Answer coming5
    See the wording in each paper