CS606- Compiler Construction MidTerm Papers Solved MCQS with Reference (1 to 22 lectures) by Arslan Arshad (Zain) FEB 21,2016 0300-2462284 http://lmshelp.blogspot.com/ Arslan.arshad01@gmail.com AKMP01 MidTerm Papers Solved MCQS with Reference (1 to 22 lectures) 1. Typical compilation means programs written in high-level languages to low-level. o Object code PG # 06 o Byted code o Unicode o Object Code and byte code 2. In compilation process, Hierarchical analysis is also called. o Parsing o Syntax o Parsing and Syntax analysis
3. IR (Intermediate Representation) stores the value of its operand in. o Registers PG # 10 o Memory o Hard disk o None Of given 4. A lexeme is a sequence of characters in the source program that is matched by the pattern for a. o Linker o Token Click Here for More Detail o Control flow 5. Parsers take as Input from lexical analyzer. o Linker o Token o Instructions 6. What kind of abstract machine can recognize strings in a regular set? o DFA o NFA o PDA
7. In multi pass compiler, during the first pass it gathers information about. o Declaration o Bindings o Static information 8. In DFA minimization, we construct one for each group of states from the initial DFA. o State PG # 30 o NFA o PDA 9. (Lexical Analyzer generator), is written in Java o Flex o Jlex Click here for More Detail PG # 31 o Complex JLex is a lexical analyzer generator, written for Java, in Java. 10. In Flex specification file, different sections are separated by. o %% PG # 31 o && o ##
11. Recursive parsing is done for LL(I) grammar. o Decent o Ascent o Forward 12. Alternative of the backtrack in parser is Look ahead symbol in. o Input o Output o Input and Output 13. Parser takes tokens from scanner and tries to generate. o Binary Search tree o Parse tree o Binary Search tree and Parse tree 14. In predictive parsing table, the rows represents. o Terminals o Both non-terminal and terminals o Non-terminals PG # 62
15. In LL(I) parsing algorithm, contains a sequence of grammar symbols. o Stack PG # 62 o Link List o Array 16. Consider the grammar A B C D B h B C C g g C h i D AB First of A is. o h, g, i o g o h 17. Consider the grammar A B C D B h B C C g g C h i D AB First of C is. o g, i o g o h, i
18. Bottom-up parsing uses only kinds of actions. o Two PG # 71 o Three o Four o Five Bottom-up parsing uses only two kinds of actions: 1. Shift, 2. Reduce Shift: Move one place to the right Shifts a terminal to the left string Reduce : Apply an inverse production at the right end of the left string 19. The shift action a terminal on the stack. o Pushes PG # 73 o Pops o Both push and pops 20. Reduce action zero or more symbols from the stack o Pushes o Pops PG # 73 o Both push and pops 21. In compilers, linear analysis is also called. o Lexical analysis o Scanning o Lexical analysis and scanning
22. Back End of two-pass compiler uses algorithm. o O(n) o O(n log n) o NP Complete o None of the Given 23. The Back End of a compiler consist of. o Instruction selection o Register allocation o Instruction scheduling o All of the given 24. In Back End module of compiler, optimal register allocation uses. o O(log n) o O(n log n) o NP-Complete 25. is a regular expression for the set of all strings over the alphabet {a} that has an even number of a' s. o (aa)* o (aa)*a o aa*a o a*(aa)
26. algorithm is used in DFA minimization. o James's o Robert s o Hopcroft s PG # 25 27. is an important component of semantic analysis. o Code checking o Type checking PG # 39 o Flush checking 28. Consider the grammar A B C D B h B C C g g C h i First of B is. o h, i o h, o g
29. Consider the grammar A B C D B h B C C g g C h i D A B First of D is. o h, g o h o h, g, i, 30. Parsers never shifts into an error state. o LS o LT o LR o LP 31. In, certain checks are performed to ensure that components of a program fit together meaningfully o Linear analysis o Hierarchical analysis o Semantic analysis
32. read the input character and produce sequence of tokens as output. o Lexical analyzer o Parser o Symbol table 33. The regular expression denotes, the set of all strings of a's and b s of length two. o a* o (a* b*)* o (a*b*)* o (a b)(a b) 34. of a two-pass compiler is consists of Instruction selection, Register allocation and Instruction scheduling. o Backend PG # 9 o Frontend o Start o None of the Given 35. is evaluated to yield a value. o Command o Expression o Declaration
36. Bottom-up parsers handle a class of grammar. o Large Click Here for More Detail PG # 49 o Small o Medium Note: Give me a feedback and your Suggestion also If you find any mistake in mcqz plz inform at above mentioned email address. And tell me your answer with references.