Compiler Design Solved MCQ 2020-21 | BCA 6 semester | HNBGU

Compiler Design Solved MCQ 2020-21

BCA 6 semester | HNBGU

  1. Users write the programs in which language?
    1. Low-Level language
    2. High level language
    3. Decimal format
    4. Middle level language


  2. Which computer program accepts the high level language and converts it into assembly language?
    1. Interpreter
    2. Linker
    3. Assembler
    4. Compiler


  3. Does the compiler program translate the whole source code in one step?
    1. No
    2. Depends on the compiler
    3. Don’t know
    4. Yes


  4. Which of the following files is an output of the assembler?
    1. Program file
    2. Object file
    3. Data file
    4. Task file


  5. Which tool is used for grouping of characters in tokens in the compiler
    1. Parser
    2. Code optimizer
    3. Code generator
    4. Scanner


  6. What is the linker?
    1. It is always used before the program execution.
    2. It is required to create the load module.
    3. It is the same as the loader
    4. None of the above


  7. Parsing is categorized into how many types?
    1. Three types
    2. Four types
    3. Two types
    4. Five types


  8. In which parsing the parser constructs tha parse tree from the start symbol and transforms it into the input symbol?
    1. Bottom up parsing
    2. Top down parsing
    3. None of the above
    4. Both (a) and (b)


  9. Which derivation is generated by the top down parser?
    1. Right most derivation in reverse
    2. Left most derivation in reverse
    3. Right most derivation
    4. Left most derivation


  10. Which derivation is generated by the top down parser?
    1. Right most derivation in reverse
    2. Left most derivation in reverse
    3. Right most derivation
    4. Left most derivation


  11. Which parser is most powerful in the following parser
    1. Operator precedence
    2. SLR
    3. Canonical LR
    4. LALR


  12. The output of the lexical analyzer is
    1. String character
    2. A syntax tree
    3. A set of Regular Expression
    4. A set of tokens


  13. From the following grammars, which describes the lexical syntax?
    1. Lexical grammar
    2. Context free grammar
    3. Syntactic grammar
    4. Regular grammar


  14. Which grammar gives multiple parse trees for the same string?
    1. Unambiguous
    2. Regular
    3. Ambiguous
    4. All of the above


  15. In compiler lexical analyzer is used for:
    1. Removing comments
    2. Removing whitespace
    3. Breaking the syntaxes in the set of tokens
    4. All of the above


  16. Which is considered as the sequence of characters in a token?
    1. Mexeme
    2. Lexeme
    3. Texeme
    4. Pattern


  17. Which part of the compiler highly used the grammar concept
    1. Code optimization
    2. Code generation
    3. Parser
    4. Lexical analysis


  18. Which phase of the compiler checks the grammar of the programming?
    1. Code optimization
    2. Semantic analysis
    3. Code generation
    4. Syntax analysisC


  19. Which of the following components is important for semantic analysis?
    1. Yace
    2. Lex
    3. Symbol Table
    4. Type checking


  20. Which phase of the compiler is also known as scanner?
    1. Syntax analysis
    2. Lexical analysis
    3. Semantic analysi
    4. Code generation


  21. Which phase of the compiler is also known as parse?
    1. Code optimization
    2. Semantic analysis
    3. Syntax analysis
    4. Lexical analysis


  22. Which of the following parser is a top down parser
    1. An LALR parser
    2. A LR parser
    3. Operator precedence parser
    4. Recursive descent parser


  23. Keywords are recognized in a compiler during
    1. The code generation
    2. The data flow analysis
    3. The lexical analysis of the program
    4. The program parsing


  24. Leaf nodes in a parse tree indicate:
    1. Sub terminals
    2. Half terminals
    3. Non terminals
    4. Terminals


  25. Which graph describes the basic block and successor relationship?
    1. Control graph
    2. DAG
    3. Flow graph
    4. Hamilton graph


  26. Which language is accepted by the push down automate?
    1. Type 0 language
    2. Type 1 language
    3. Type 2 language
    4. Type 3 language


  27. The most general phase of structured grammar is
    1. Context sensitive grammar
    2. Context free grammar
    3. Regular grammar
    4. All of the above


  28. In the compiler the function of using intermediate code is:
    1. To improve the register allocation
    2. To increase the error reporting and recovery
    3. To make semantic analysis easier
    4. To increase the chance of re using the machine independent code optimizer in other compiler


  29. In how many types of optimization can be divided?
    1. 2
    2. 3
    3. 4
    4. 5


  30. The value of which variable is updated inside the loop by a loop invariant value?
    1. Loop
    2. strength
    3. induction
    4. invariable


  31. Which compiler runs on one machine and generates code for multiple machines
    1. Multipass compiler
    2. Cross compiler
    3. Optimizing compiler
    4. One pass compiler


  32. Which of the following is not a characteristic of the compiler?
    1. More execution time
    2. Debugging process is slow
    3. The execution takes place after the removal of all syntax errors
    4. Firstly scans the entire program and then transforms it into machine understandable code


  33. Which phenomenon happens when the nonterminal on the left side is repeated as the first symbol on the right side?
    1. Left most derivation
    2. Left recursion
    3. Left factoring
    4. Left parsing


  34. In which derivation the right most non terminal symbol is replaced at each step?
    1. Right look ahead
    2. Right claim
    3. Right most
    4. Right non terminal


  35. In which derivation the leftmost non terminal symbol is replaced at each step?
    1. Left recursion
    2. Left non terminal
    3. Left pushdown
    4. Left most