• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Lexical analysis

Question 11

From the given data below : a b b a a b b a a b which one of the following is not a word in the dictionary created by LZ-coding (the initial words are a, b)?
  • a b
  • b b
  • b a
  • b a a b

Question 12

The number of tokens in the following C statement is printf("i=%d, &i=%x", i,&i);

  • 13

  • 6

  • 10

  • 9

Question 13

In compiler optimization, operator strength reduction uses mathematical identities to replace slow math operations with faster operations. Which of the following code replacements is an illustration of operator strength reduction ?
  • Replace P + P by 2 * P or Replace 3 + 4 by 7.
  • Replace P * 32 by P < < 5
  • Replace P * 0 by 0
  • Replace (P < <4) – P by P * 15

Question 14

Debugger is a program that
  • allows to examine and modify the contents of registers
  • does not allow execution of a segment of program
  • allows to set breakpoints, execute a segment of program and display contents of register
  • All of the above

Question 15

A particular BNF definition for a "word" is given by the following rules. Which of the following lexical entries can be derived from < word > ? I. pick II. picks III. c44

  • I, II and III

  • I and II only

  • l and III only

  • lI and III only

There are 15 questions to complete.

Last Updated :
Take a part in the ongoing discussion