If all the operators are binary, then a string of operands and operators is a postfix expression if and only if ________
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 all the operators are binary, then a string of operands and operators is a postfix expression if and only if ________
Given a grammar G=(V, T, P, S) and every production in P is of the form A->α where A is in V and α is in (V U T)*, then G is ________
A compiler running on computers with a small memory would normally be ________
Input to LEX is ________
A basic block is ________
Given a finite automaton M=(Q,Σ, δ, q0, F). If δ maps Q × Σ to 2 Q, then ________
Given a string abc, the string acc is a ________
A garbage is ________
How many descriptors are used for track both the registers (for availability) and addresses (location of values) while generating the code?
A synthesized attribute is an attribute whose value at a parse tree node is defined in terms of ________
Elimination of loop invariant computation is a peephole optimization. True/False?
________ is a loop optimization
Describe input buffering in lexical analyser.
Explain the model of a non recursive predictive parser with a diagram.
Find the output, given grammar G1 and associated semantic rules and input: aadbdb • S->AS [print(1)] • S->AB [print(2)] • A->a [print(3)] • B->b C [print(4)] • B->d B [print(5)] • C->c [print(6)]
What is ambiguity? Show that G2:{S->aS|Sa|a} is ambiguous
What is code optimization? Optimize the following C-code: count=0; result=0; while(count++ < 20) { increment= 2*count; result +=increment; }
For the following grammar E-> E or T|T T->T and F|F F-> not F|(E)|0|1 a) Eliminate left recursion from the above grammar b) Find FIRST(X),Follow(X) for each variable in the grammar c) Construct a predictive parser table for the grammar d) Is the above grammar LL(1). Justify your answer
a) What is a compiler? b) Explain the different phases of compiler with an example c) Compare and contrast between a compiler and an interpreter
i) Express the expression y=(a+b)*c in a.) postfix notation b.) Abstract syntax tree c.) Three address code ii) Implement the TAC using a. quadruples b. triples c. indirect triples
Consider the regular expression (a+b)*(a+b)(a-b) I. Augment the expression and construct the syntax tree for the above regular expression II. Find Firstpos() and Lastpos() for every internal node in the syntax tree III. Find Followpos() for every position in the syntax tree IV. Construct the corresponding DFA for the given RE using Followpos()
11. a) What is LEX? b) Explain the working of LEX c) Show the step by step construction of a lexical analyzer with the following three tokens • a • abb • a*b+