Compiler Design

Test covers compiler design concepts frequently asked in UGC NET and GATE examinations, including lexical analysis, syntax analysis, semantic analysis, code optimization, code generation, and runtime environment.

17 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is not a compiler construction tool?

  1. Parser generator
  2. Data-flow engine
  3. Automatic code generator
  4. Preprocessor
  5. Syntax-directed translation engine
Question 2 Multiple Choice (Single Answer)

Which of the following is not an item regarding each I/O variable of an I/O list for compiling the I/O list?

  1. I/O length
  2. I/O type
  3. Dimension information
  4. Compile time address
  5. Runtime address
Question 3 Multiple Choice (Single Answer)

A sequence of characters in the source program that is matched by the pattern for a token is called

  1. lexeme
  2. pattern
  3. token
  4. alphabet
  5. identifier
Question 4 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about copy restore method?

  1. Copy restore method is a hybrid between call by value and call by name.
  2. Copy-in-copy-out is another name for copy restore.
  3. Calling procedure calculates the value of the actual parameter and it then copies to activation record for the called procedure.
  4. During execution of called procedure, the actual parameter value is not affected.
  5. If the actual parameter has L-value, then at return, the value of formal parameter is copied to actual parameter.
Question 5 Multiple Choice (Single Answer)

When a compiler uses a set of assignment instructions that occur in the program for analysis, it is called

  1. jump analysis
  2. index-check elimination
  3. inlining
  4. analysis available assignment
  5. tail-call optimization
Question 6 Multiple Choice (Single Answer)

Which of the following is not an item of format list for compiling the format list?

  1. Format element type
  2. Format length
  3. Descriptor w[Field width]
  4. Descriptor d[Number of digits]
  5. Replication factor
Question 7 Multiple Choice (Single Answer)

Which unit of activation record is a static link field that stores the information of data which is outside the local scope?

  1. Control link
  2. Machine status
  3. Local data
  4. Access link
  5. Actual parameter
Question 8 Multiple Choice (Single Answer)

Which error recovery strategy performs local correction on the input to repair the error?

  1. Global correction
  2. System-level recovery
  3. Phrase-level recovery
  4. Panic mode error recovery
  5. Local correction error recovery
Question 9 Multiple Choice (Single Answer)

Annotated parse tree is an output of

  1. code generator
  2. scanner
  3. semantic analyzer
  4. parser
  5. intermediate code generator
Question 10 Multiple Choice (Single Answer)

Which of the following loop optimization techniques combines the multiple loops that perform different calculation for the same loop iteration?

  1. Loop unrolling
  2. Loop-invariant code motion
  3. Loop jamming
  4. Induction analysis
  5. Strength reduction
Question 11 Multiple Choice (Single Answer)

Which of the following is not an issue of code generation?

  1. Instruction selection
  2. Evaluation order
  3. Register allocation
  4. Common sub-expression elimination
  5. Target program
Question 12 Multiple Choice (Single Answer)

Which of the following is/are an issue of machine-independent optimization?

  1. Register allocation
  2. Structure-preserving transformations
  3. Instruction cost
  4. Memory management
  5. Input and output formats
Question 13 Multiple Choice (Single Answer)

Which of the following structure-preserving transformations moves the evaluation of expressions from one part of the program to another part of the program?

  1. Code motion
  2. Strength reduction
  3. Variable propagation
  4. Interchanging of statements
  5. Dead-code elimination
Question 14 Multiple Choice (Single Answer)

Not reachable statements due to wrongly written function calls is an error generated by which of the following phases of compiler?

  1. Syntax analysis
  2. Semantic analysis
  3. Symbol table
  4. Code optimization
  5. Intermediate code generation
Question 15 Multiple Choice (Single Answer)

Which of the following is the correct type checking expression for the given production rule?

E -> (E1, E2)

  1. {E.type = pointer(E1.type)}
  2. {E.type = tuple(E1.type, E2.type)}
  3. {E.type = if (E1.type = arrow(S,T) & E2.type = S) then T else error}
  4. {E.type = if (E1.type = array(S,T) & E2.type = int) then T else error}
  5. {E.type = if E1.type = pointer(T) then T else error}
Question 16 Multiple Choice (Single Answer)

Which of the following is a compile time error?

  1. Divide by zero
  2. Semantic error
  3. Pointers going
  4. Indices going
  5. Infinite loop
Question 17 Multiple Choice (Single Answer)

Which of the following is an incorrect option about runtime storage organization?

  1. In storage organization, compiler demands for a block of memory to operating system. The compiler utilizes this block of memory executing the compiled program. This block of memory is called runtime storage.
  2. Runtime storage is divided into parts to hold data and code.
  3. The amount of memory required by data objects is known at the time and hence, data objects also can be placed at the statically determined area of memory.
  4. The size of generated code is dynamic.
  5. In runtime storage, stack is used to manage the active procedure.