Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Explain top-down parsing. Construct the predictive (LL(1)) parsing table for the grammar E -> E+T | T, T -> T*F | F, F -> (E) | id after removing left recursion.

top-down-parsingll1
2long10 marks

Explain code optimization. Discuss the principal sources of optimization and the various machine-independent optimization techniques.

code-optimization
3long10 marks

Discuss target code generation. Explain register allocation and the issues in the design of a code generator.

code-generation
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Differentiate between a compiler and an interpreter.

compiler
5short5 marks

Eliminate left recursion and perform left factoring on the grammar A -> Aab | Ac | bd | f.

grammarparsing
6short5 marks

What is a symbol table? Explain its role in a compiler.

symbol-table
7short5 marks

Differentiate between a parse tree and a syntax tree.

parsing
8short5 marks

What is an ambiguous grammar? Show with an example.

grammar
9short5 marks

Explain the role of the lexical analyzer in a compiler.

lexical-analysis
10short5 marks

Differentiate between LL(1) and LR parsers.

parsing
11short5 marks

What are regular expressions? Write a regular expression for identifiers.

regular-expressionlexical-analysis
12short5 marks

Explain the handle and handle pruning in shift-reduce parsing.

parsing