Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Identify the significance of compiler with an example.

Enlist cousins of the compiler and give its importance.

Illustrate why buffering is used in Lexical Analysis? List out the commonly used buffering methods

Compare tokens, patterns and lexemes with examples.

State the use of symbol table with an example

Construct the Regular expression for the set of input alphabets a & b in which set of strings have zero or any
number of a and b followed by bba.

Compute regular definition for an identifier.

Paraphrase the use of sentinels. Give an example for Left Most Derivation using sentinels.

Differentiate bottom up and top-down parser with an example.

Differentiate Compiler and Interpreter.

List out compiler construction tools with its significance.

Illustrate the role of a lexical analyzer.

Discuss Handle Pruning with an example.

Identify the tokens generated by the statement a := b * d - 60

Construct the transition diagram for an unsigned constant.

Show that the following grammar is Ambiguous Grammar or not.

S → aSbS

S → bSaS

S→ε

Illustrate that how backtracking can be used in recursive decent parser.

Annotate the term regular definition? Give example.

List the specification of tokens.

Recall the basic three parts of YACC implementation.

Comment on Parser and its roles.

Infer the syntax tree for the expression –(id+id).

Identify the given grammar E->E+E;E->E*E;E->(E);E->id, is ambiguous or not.

Construct the symbol table for a simple program of adding two numbers.

Identify the difference between LL and LR Parser.

Define sentinel, buffer pairs.

Build a grammar from eliminating left recursion in the following production: S->S*C/C; C->Cb/F; F->id
Recall the basic two parts of the compilation process.

Construct the syntax tree for the expression a=b*-c+b*-c.

Illustrate dramatically how a language is processed.

Eliminate left recursion from the following grammar.

A->Ac/Aad/bd

Derive the string aaabbabbba using the grammar below(using leftmost derivation and rightmost derivation).

S->aB|bA

A->a|aS|bAA

B->b|bS|aBB

Draw NFA and transition table for the regular expression (ab* | ba*)

Define tokens, patterns and lexemes.

Differentiate top down parsing and bottom up parsing.

Write the algorithm for left factoring of a grammar.

Explain the various Phases of Compiler in detail. Write the output for each phase of the compiler for the
expression q:=r+t*45.

Construct a Deterministic Finite Automata recognizing the language containing string that are multiples of 4
when represented in binary.

Inspect the role of Lexical analyzer with suitable examples.

Write the algorithm for the construction of Predictive parsing table for the given grammar. Also construct the
parsing table for the grammar

E->E+T/T

T->T*F/F

F->E/id

Describe the term compiler and explain different phases of a compiler and show how the source code a := b + d *
60 is translated at various phases.

Explain the role of parser with an example.

Consider the grammar S → (L) | a L → L,S | S

a. Eliminate Left-recursion

b. Find FIRST and FOLLOW

c. Construct a predictive parser


d. Check that the string (a, (a,a)) accepted by given grammar.

Describe the Synthesis part of a compiler and show how the given intermediate code is translated to object code
at various phases for an example: position=initial+rate*10

Construct the DFA for the following regular expression using direct method: (a+b)*abb

Construct a recursive descent parser with backtracking for the following grammar: S->cAd A->ab/a for the
string cad.

Consider the grammar E->E+T/T T->T*F/F F->(E)/id

a. Eliminate Left-recursion

b. Construct a predictive parser

c. Show the behavior of the parser on the string id+id*id

Illustrate the various phases of compiler and trace it with program segment position:=initial+rate*60.

Compute predictive parsing table and parse the string id+id*id.

And find FIRST and FOLLOW.

E→E+T | T

T→T*F | F

F→(E) | id

Construct Stack implementation of shift reduce parsing for the grammar and parse the input string id1+id2*id3

E->E+E

E->E*E

E->(E)

E->id

You might also like