Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Explain the different phases of a compiler with a suitable diagram, showing the output of each phase for the statement position = initial + rate * 60.

phasescompiler
2long10 marks

Construct the LR(1) parsing table for the grammar S -> CC, C -> cC | d and parse the input string cdd.

lr-parsingparsing
3long10 marks

What is a directed acyclic graph (DAG)? Represent the expression a + a * (b - c) + (b - c) * d using three-address code, quadruples and triples.

dagintermediate-code
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