Compiler Design
Question What do you mean by translator software. Differentiate between compiler and interpreter.
NU Year 2016
Question Define preprocessors. What are the functions of preprocessors?
NU Year 2016
Question What are the phases of analysis and describe them?
NU Year 2016
Question Describe the language processing system.
NU Year 2016
Question Define parser. What are the difference between top bottom-up parser?
NU Year 2016
Question Explain handle and handle pruning.
NU Year 2016
Question What is shift-reduce parser? What are the actions allowed in shift-reduce parser?
NU Year 2016
Question Consider the following grammar E → E+E I E*E | (E) | id Show the shift-reduce parsing actions in stack lift for the input string id1 + id2 * id3
NU Year 2016
Question Consider the following grammar: E → E + T | T T→ T * F | F F→ (E) | id Now eliminate the immediate left-recursion
NU Year 2016
Question What an the differences between DFA and NFA?
NU Year 2016
Question Write down the algorithm for simulating a DFA?
NU Year 2016
Question Define regular definition. Give the regular definition for unsigned numbers in Pascal.
NU Year 2016
Question Explain the plan of an error detector/correcter with figure
NU Year 2016
Question Explain the error-recovery strategies
NU Year 2016
Question Translate the following infix expression into its equivalent prefix expression:- (i).(A+ B * D)/(E - F) +G (ii) A * (B + D)/E-F*(G+H+ K)
NU Year 2016
Question What is code optimization? How compiler optimizes source code?
NU Year 2016 2013
Question Translate the arithmetic expression [a + a * (b - c)] + [(b - c) *d] into: (i) Three address code (ii) Quadruples (iii) Triples
NU Year 2016
Question What is DAG? Construct the DAG for the following basic block:- D: = B * C E : = A + B B : = B * C A : = E - D
NU Year 2016
Question Explain the problems in code generation
NU Year 2016
Question what do you mean by copy propagation and du-chaining?
NU Year 2016
Question Define basic block. Write down the algorithm for partitioning into basic blocks
NU Year 2016
Question What are the issue in the design of code generator ?
NU Year 2016
Question Write down the algorithm for partitioning into basic block
NU Year 2016
Question Describe the structure-prescribing transformation on basic block
NU Year 2016
Question Describe the peephole optimization.
NU Year 2016
Question Define compiler. Illustrate the representation of the following statement after each phase of a compiler : Position = initial + rate x 60.
NU Year 2014
Question What are the reasons for separating the analysis phase of compiling into lexical analysis and parsing?
NU Year 2014
Question What are the phase of analysis and describe them.
NU Year 2014
Question Define preprocessor. What are the functions of preprocessor?
NU Year 2014
Question Discuss the relationship between input, lexical analyzer and parser
NU Year 2014
Question What is regular expression? Construct a NFA for the following regular expression: (a I b) * abb.
NU Year 2014
Question Define token, pattern and lexeme with examples.
NU Year 2014
Question What are the advantages context free grammars offer in describing syntax of programming language constructs over Backus-Naur Form (BNF)?
NU Year 2014
Question Write down the algorithm for left factoring a grammar.
NU Year 2014
Question What is LR parser? Write down its importance.
NU Year 2014
Question What is predictive parsing? Construct the parsing table for the following grammar: E → T E' E' → + T E l e T → F T' T' → * F T' l e F→ (E) I id
NU Year 2014
Question What are the main problems of top-down parsing? Consider the grammar: E→ E + T I T T→ T * F I F F→ (E) I id Is there any problem in this grammar for top-down parsing? Eliminate the problems if any.
NU Year 2014
Question what are the actions allowed in shift-reduction parser? Consider the grammar: E→ E+E l E*E l (E) l id show shift-reduction actions in stack for the input string id1 + id2 * id3.
NU Year 2014
Question Considcr the grammar S → i CtS S → i CtSeS S → a S → b Derive the sentence w = ibtibtaea using left most and right most derivation with parse tree
NU Year 2014
Question How can you find the handle from the operator precedence parsing?
NU Year 2014
Question Create a syntax. tree and DAG for the statement a: = b * - c + b * -c.
NU Year 2014
Question What are the implementation techniques of three-address statements? Describe with example.
NU Year 2014
Question Describe the code generation algorithm.
NU Year 2014
Question What are the issues in the design of a code generator?
NU Year 2014
Question Describe the loop optimization technique.
NU Year 2014
Question The assignment d : = (a - b) + (a - c) + (a - c) might be translated into the following three-address code sequence t : = a - b u : = a - c v : = t + u d : = v + u with d live at the end. What are the code sequence for the above three address code using the code generation algorithm?
NU Year 2014
Question Write down the algorithm for partitioning into basic block from three-address code sequence.
NU Year 2014
Question What do you mean by register and address descriptor?
NU Year 2014
Question What is compiler? Explain the different phases of compiler.
NU Year 2013
Question Why do we need translators?
NU Year 2013
Question What do you mean by three address code? Describe with an example.
NU Year 2013
Question Define CFG. What are the components of CFG?
NU Year 2013
Question How does a lexical analyzer interface between input stream and a parser?
NU Year 2013
Question Consider the context free grammar s → ss + | ss* | x. Show how the string xx + x* can be generated by this grammar.
NU Year 2013
Question Construct a DFA for the regular expression (a l b) * abb.
NU Year 2013
Question Write the rules for FIRST and FOLLOW.
NU Year 2013
Question Consider the grammar E → TE' E' → + TE' l e T → FT' T → * FT' I e F → (E) I id. Now, generate the parsing table for this grammar.
NU Year 2013
Question What is the purpose of syntax directed translation? Briefly explain.
NU Year 2013
Question Write the algorithm for operator precedence parsing.
NU Year 2013
Question What is symbol table? What are the contents of symbol table?
NU Year 2013
Question Explain the data structures for symbol tables.
NU Year 2013
Question Evaluate the postfix expression ab + c* , where a = 1, b = 3 and c = 5.
NU Year 2013
Question Breifly describe the principles of representing the value of Boolean expression.
NU Year 2013
Question What is dag? What are the applications of dag? Write down the algorithm for constructing a dag.
NU Year 2013
Question Describe the structure-preserving transformations on basic block.
NU Year 2013
Question Describe the peephole optimization briefly.
NU Year 2013
Question What are the properties of good error diagnostic?
NU Year 2013
Question What are the sources of errors?
NU Year 2013
Question What do you mean by copy propagation and dead code elimination?
NU Year 2013
Question Define compiler. What are the differences between compiler and interpreter?
NU Year 2012
Question What do you mean by preprocessor? What are the operations of preprocessor?
NU Year 2012
Question What do you mean by token? Describe different types of tokens
NU Year 2012
Question What is symbol table? Write down the functions of a symbol table.
NU Year 2012
Question What are the differences between DFA and NFA?
NU Year 2012
Question Write the algorithm to minimize the number of state of a DFA
NU Year 2012
Question What are the main functions of lexical analyzer? List the various error recovery strategies in lexical analysis
NU Year 2012
Question Define regular expression with example. What are the rules of constructing regular expression?
NU Year 2012
Question What do you mean by CFG? Consider the following grammar: s → iCtss' I a s' → es l e c → b Now draw the parsing table.
NU Year 2012
Question Define parser. predictive parser and handle pruning.
NU Year 2012
Question Write the algorithm to construct SLR parsing table.
NU Year 2012
Question Define LR parser. Explain the functions values of ACTION function in LR parser.
NU Year 2012
Question What do you mean by shift-reduce parsing? What are the four possible actions of a shift-reduce parsing?
NU Year 2012
Question What do you mean by shift-reduce parsing? What are the four possible actions of a shift-reduce parsing?
NU Year 2012
Question Define top down parsing. What are the problems of top down pursing?
NU Year 2012
Question How can you find the handle from the operator precedence parsing?
NU Year 2012
Question Construct a left-factor for the following grammar :s → iCts l iCtses I ac → b.
NU Year 2012
Question Translate the following infix expression into its equivalent postfix expression :-(i) (A + B ↑ D) / (E - F) + G;(ii) A * (B + D) / E - F * (G+H / K)
NU Year 2012
Question Draw the figure of error detector and corrector. What are semantic error? Explain with example
NU Year 2012
Question What are the reasons for separating the analysis phase of compiler into lexical analysis and parsing?
NU Year 2012
Question What are the advantages of machine independent intermediate code?
NU Year 2012
Question What are the types of errors? What are the properties of good error diagnostics?
NU Year 2012
Question Describe the loop optimizations briefly.
NU Year 2012
Question Write down the code-generation algorithm.
NU Year 2012
Question Describe the plan of error detector/corrector.
NU Year 2012
Question What is a Compiler? Briefly explain different phases of a compiler.
NU Year 2011
Question What are the different kinds of errors encountered during compilation?
NU Year 2011
Question What is the need for separating the analysis phase into lexical analysis and parsing?
NU Year 2011
Question What is a symbol table? Describe the functions of a symbol table.
NU Year 2011
Question How does an input buffer work and write its code?
NU Year 2011
Question Translate the following infix expression into its equivalent postfix expression :-(i) (A + B ↑ D) / (E - F) + G(ii) A*(B + D) / E-F* (G + H / K)
NU Year 2011
Question Describe the associativity of operators with example.
NU Year 2011
Question What do you mean by token, lexeme and identifier?
NU Year 2011
Question How will you define a context a grammar? when will you say that two CFGs are equal?
NU Year 2011
Question Distinguish between NFA and DFA. Construct a DFA for the regular expression (a/b)* abb.
NU Year 2011
Question What do you mean by ambiguity of a grammar? Explain with example
NU Year 2011
Question Why do we use regular expressions to define the lexical syntax of a language?
NU Year 2011
Question What are the actions allowed in shift-reduction parser? Consider the following grammar:-E→ E + E/E * E / (E)/EShow shift reduction actions in stack for the input stringid1 + id2 * id3. in shift-reduction parser?
NU Year 2011
Question What is top-down and predictive parsing Consider the following grammar :-E→ E + T/TT→ T * F/FF→ (E) / idWhat are the problems of above grammar for top-down parsing? Eliminate the problems.
NU Year 2011
Question List advantages and disadvantages of operator precedence parsing
NU Year 2011
Question How precedence relations are used? Explain a heuristic to produce a proper set of precedence relations
NU Year 2011
Question What is dag? What are the applications of dag? Write down the algorithm for constructing a dag.
NU Year 2011
Question Define three-address code with example. What are the implementations method of three-address code? Describe with example.
NU Year 2011
Question Define basic block and write down the algorithm for partitioning into basis blocks.
NU Year 2011
Question Describe the structure-preserving transformation on basic block.
NU Year 2011
Question What are the properties of good error diagnostic?
NU Year 2011
Question What do yon mean by peephole optimization? Describe peephole optimization.
NU Year 2011
Question What are the issues in the design of a code generator?
NU Year 2011
Question Define translator software.What are the differences between compiler and interpreter?
NU Year 2010
Question Describe different phases of compiler with example
NU Year 2010
Question What is symbol table? What are the functions of symbol table?
NU Year 2011
Question What are the types of errors found in different phases of compiler?
NU Year 2010
Question Define CFG, Parse Tree.
NU Year 2010
Question What do you mean by tokens? Describe different types of tokens
NU Year 2010
Question How does a lexical analyzer interface between input stream and a parser?
NU Year 2010
Question Define lexeme. What am: the properties of a parse tree?
NU Year 2010
Question Give formal definition of context free grammar. What are the components of context-tree grammar?
NU Year 2010
Question Write regular expression for each of the following sets of binary strings:-(i) All strings containing exactly one 0.(ii) All strings where each 0 is followed by at least one 1.(iii) All strings containing no more than three os.(iv) All strings not ending in 01
NU Year 2010
Question What do you mean by parsing? Differentiate between top-down parsing and bottom-up parsing.
NU Year 2010
Question Consider context-free grammar:S→ SS + I SS* I aConstruct a parse tree for the string aa + a*
NU Year 2010
Question What do you mean by syntax-directed definition? Briefly explain inherited attributes in syntax-directed definitions with examples.
NU Year 2010
Question Give the production. semantic rules and parse tree for 3 * 5 + 4n with respect to syntax-directed definition.
NU Year 2010
Question Translate the arithmetic expression [ a + a * ( b - c)] + [ (b - c) * d ] into:-(i) Three address code;(ii) Quadruples;(iii) Triples.
NU Year 2010
Question Give the regular definition for unsigned numbers in Pascal and identifiers
NU Year 2010
Question Describe about NFA and DFA
NU Year 2010
Question Write down the algorithm constructing DFA from an NFA (sub-set construction role).
NU Year 2010
Question Construct an DFA for the regular expression (a l b)* abb.
NU Year 2010
Question What do you mean by optimizing compiler?
NU Year 2010
Question Describe the organization of the code optimizer.
NU Year 2010
Question Give an algorithm that runs in time O(n) on an n-node flow graph to find the expended flow graph.
NU Year 2010
Question Write short notes on :-(i) Error-recovery strategies;(ii) Operations on languages;(iii) Loop optimization.
NU Year 2010
Question Define compiler.Describe the different phases of compilation process.
NU Year 2009
Question What are the differences between compiler and interpreter?
NU Year 2009
Question What is compiler-compiler? What are the advantages and disadvantages of using compiler-compiler in compiler writing process?
NU Year 2009
Question What is preprocessor? Describe the functions of preprocessor.
NU Year 2009
Question Discuss the relationship between input, lexical analyzer and parser.
NU Year 2009
Question What are the reasons for separating the analysis phase of compiling into lexical analysis and parsing?
NU Year 2009
Question Describe the panic mode error recovery strategy. What are the lexical error recovery actions?
NU Year 2009
Question Define token, pattern and lexeme with examples .
NU Year 2009
Question What is transition diagram? Draw a transition diagram for relational operators.
NU Year 2009
Question Consider the following grammar:A→ AcB l cC l CB→ bB l idC→ Cab l BbB l BIs it an ambiguous grammar? Justify your answer.
NU Year 2009
Question Consider the following grammar :E→E+T l TT→ T *F l FF→ (E) l idEliminate the immediate left recursion from the grammar.
NU Year 2009
Question Write down the algorithm for left factoring a grammar.
NU Year 2009
Question What is LR parser? Write down its importance.
NU Year 2009
Question Consider er the following grammar:-S→ AS l bA→ SA l a(i) List all the LR(O) items.(ii) Construct SLR parsing table.
NU Year 2009
Question What is predictive parsing? Compute the FIRST and FOLLOW of the following grammar :E→TE'E'→+TE' I cT→ FT'T'→*FT' I cF→ (E) l id.
NU Year 2009
Question What do you mean by handle pruning?
NU Year 2009
Question What are the benefits of using a machine independent intermediate code?
NU Year 2009
Question What do you mean by three address code? What are the implementation techniques of three address code? Describe with example.
NU Year 2009
Question Translate the executable statements of the following C programmain (){int i;int a[10];i= 1;while (i<= O) { a[i] = 0; i = i+1; }}into (i) a syntax tree (ii) postfix notation (iii) three address code.
NU Year 2009
Question Define basic block. Write down an algorithm to partition a sequence of three address statements into basic blocks.
NU Year 2009
Question Describe the peephole optimization technique.
NU Year 2009
Question What do you mean by dead code elimination?
NU Year 2009
Question Construct a Directed a Acyclic Graph (DAG) for following block of three address code:(1) t1 := 4*i(2) t2 : = a[t1](3) t3 : = 4*i(4) t4 : = b(t3)(5) t5 : = t2*t4(6) t6 : = prod + t5(7) prod : = t6(8) t7 : = i+1(9) i : = t7(10) if i ← 20 goto(1)
NU Year 2009