• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Parsing and Syntax directed translation

Question 61

Shift reduce parsing belongs to a class of
  • bottom up parsing
  • top down parsing
  • recursive parsing
  • predictive parsing

Question 62

Which of the following productions eliminate left recursion in the productions given below: S → Aa | b A → Ac | Sd | ε

  • S → Aa | b A → bdA\' A\' → A\'c | A\'ba | A | ε

  • S → Aa | b A → A\' | bdA\', A\' → cA\' | adA\' | ε

  • S → Aa | b A → A\'c | A\'d A\' → bdA\' | cA | ε

  • S → Aa | b A → cA\' | adA\' | bdA\' A\' → A | ε

Question 63

Which one from the following is false?
  • LALR parser is Bottom - Up parser
  • A parsing algorithm which performs a left to right scanning and a right most deviation is RL (1)
  • LR parser is Bottom - Up parser.
  • In LL(1), the 1 indicates that there is a one - symbol look - ahead.

Question 64

Which phase of compiler generates stream of atoms?
  • Syntax Analysis
  • Lexical Analysis
  • Code Generation
  • Code Optimization

Question 65

Shift-Reduce parsers perform the following:
  • Shift step that advances in the input stream by K(K > 1) symbols and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol.
  • Shift step that advances in the input stream by one symbol and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol.
  • Shift step that advances in the input stream by K(K = 2) symbols and Reduce step that applies a completed grammar rule to form a single tree
  • Shift step that does not advance in the input stream and Reduce step that applies a completed grammar rule to form a single tree.

Question 66

Which of the following is true?
  • Canonical LR parser is LR (1) parser with single look ahead terminal
  • All LR(K) parsers with K > 1 can be transformed into LR(1) parsers.
  • Both (A) and (B)
  • None of the above

Question 67

In a two-pass assembler, symbol table is
  • Generated in first pass
  • Generated in second pass
  • Not generated at all
  • Generated and used only in second pass

Question 68

How many tokens will be generated by the scanner for the following statement ? x = x ∗ (a + b) – 5;
  • 12
  • 11
  • 10
  • 07

Question 69

Incremental-Compiler is a compiler
  • which is written in a language that is different from the source language
  • compiles the whole source code to generate object code afresh
  • compiles only those portion of source code that have been modified.
  • that runs on one machine but produces object code for another machine

Question 70

DU-chains(Definition-Use) in compiler design
  • consist of a definition of a variable and all its uses, reachable from that definition
  • are created using a form of static code analysis
  • are prerequisite for many compiler optimization including constant propagation and common sub-expression elimination
  • All of the above

There are 85 questions to complete.

Last Updated :
Take a part in the ongoing discussion