If w is a string and |w| = n then the number of prefixes of w are ______.
Official theoretical question paper for Compiler Design (PCC-CS501) conducted by Maulana Abul Kalam Azad University of Technology. All questions from Groups A, B, and C are reproduced below with marks weightings.
If w is a string and |w| = n then the number of prefixes of w are ______.
Given two DFA's M1 and M2. They are equivalent if ______.
YACC is a ______.
The number of subsequences of a string w of length n are ______.
______ phase of compilation process is an optional phase.
LEX is a ______.
Constant folding means ______.
A block kills an expression x op y iff ______.
Code generator uses ______ function to determine the status of available registers and the location of name values.
The intersection of a regular language and a context free language is ______.
A left recursive grammar cannot be LL(1). (True/False)
If G=(V, T, P, S) is a context free grammar. Then L(G) will be infinite iff ______.
Describe the language processing system with a diagram.
Represent the following sets by regular expression: a. {0,1,2} b. The set of all strings over {a,b} which consists of all words with exactly two a's c. The set of all strings over {a,b} which consists of all words that contain aaa or bbb as substring
What is a left recursive grammar? Remove left recursion from the grammar G:{S->Aa | b, A->Ac | Sd | ε}.
What do you mean by Syntax directed translation? Compare and contrast between S-Attributed SDT and L-attributed SDT.
Why left recursive grammar is not suitable for predictive parsers? Remove left recursion from the grammar G:{E->E+T | T, T->T*F | F, F->F* | a | b}
Consider the following augmented grammar: S'->S S->CC C->c C C->d a) Construct the Set of LR(1) Items for the above grammar b) Construct an LALR parsing table for the same c) Show which states LA LR parser could be combined and why d) Construct the corresponding CLR parsing table
a) What do you mean by Peephole Optimization? b) Explain with example (i) Constant Folding (ii) Common sub-expression elimination (iii) Loop unrolling (iv) Loop jamming c) What do you mean by redundant Load Store Statement?
Generate three address codes for I. indexed assignments II. pointer assignments III. conditional statements
Consider the following three address code segment: I. prod:=0 II. i:=1 III. t1:=4*i IV. t2:=addr(A)-4 V. t3:=t2[t1] VI. t4:= addr(B)-4 VII. t5:=t4[t1] VIII. t6:=t3*t5 IX. prod:=prod + t6 X. i:=i+1 XI. if i<=20 goto(3) I. Find the basic blocks and flow graph of the above sequence. II. Optimize the code sequence by applying function preserving transformation and loop optimization techniques.
a) Discuss the following parameter passing techniques with suitable example: i. Call by value ii. Call by reference iii. Call by name b) Discuss the following storage allocation strategies: i. Stack allocation ii. Heap allocation c) Show the activation records and display just after the procedure call. program main(); procedure p; function q(a: integer) : integer; begin if (a=) then q:=1; else q:= a+q(a-1); end begin q(3); end; begin p; end;