

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
previous year question paper which help you in your examination
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Question Bank Q a) Differentiate between the Compiler and Interpreters. b) What is cross compiler? c) How YACC can be used to generate parser? d) What do you mean by a regular expression? e) State the problems associated with the top down parsing. f)What is translator? g)Write down the shot note on symbol table. i)What is the role of left recursion? Q2. What is the role of left recursion? Consider the following grammar: S → Aa/b, A → Ac/Sd/e. Check whether left recursion exists and remove the left recursion. Q3. Explain all the necessary phases and passes of a compiler design. Q4. Explain how stack implementation of predictive parsing is done, considering the grammar: E → TE', E' → +TE'/€, T → FT', T' → FT'/€, F → (E)/id and input string as id+idid. Q5. Discuss the operator-precedence parsing algorithm. Consider the following operator grammar. Compute the operator precedence table and precedence functions.* higher precedence then + and left associative. E → E+E/E*E/ (E)/id. Q6. How does finite automata useful for lexical analysis? Construct the NFA and DFA for the following regular expression **(a+b) ***^ abb.
Q7.Construct the SLR parser table for the grammar: E ’^ → E, E → E+T/T, T → TF/F, F → (E)/id. Q8. Write a CF grammar to represent palindrome. Q9.Construct the minimized DFA for regular expression (0+1)(0+1)10. Q10.Eliminate le� recursion from the following grammar S→AB, A→BS/b, B→SA/A. Q.11 Explain non recursive predic�ve parsing. Consider the following grammar and construct the predic�ve parsing table. E→TE', E’→+TE'/ €, T → FT', T → FT'/€, F → F/a/b. Q12.Draw NFA for the regular expression ab*/ab. Q13. What is a cross compiler? How is boot-strapping of a compiler done to a second machine? Q.14 Discuss the challenges in compiler design. Q15 What do you mean by ambiguous grammar?Show that the following grammar is ambiguous.
S → aSbS/bSaS/€. Q16 Write down the regular expression for )i The set of all string over {a,b} such that fifth symbol from right a. )ii the set of all string over {a,b} such that every block of consecutive symbol contain at least two zero. Q.17Construct the CLR parse table for the following grammar. S → CC, C → cC, C → d. Q.18Show that the following grammar. S → Aa/bAc/Be/bBa, A → a, B → d is LR(1) but not LALR(1). Q.19 Give algorithm for constructing of predicting parsing table. Consider the following grammar and construct predictive parsing table. S → iEtSS'/a S' → eS/€. E → b Q20.Remove left recursion from grammar E → E(T)/T T → T(F)/F F → id. Q.21What do you mean by ambiguous grammar?Show that the following grammar is ambiguous. S → aSbS/bSaS/€. Q.22 What do you mean by operator precedence grammar? Compute the operator precedence table for the given grammar. E → E+T/T T → T*F/F F → (E)/id