Self Studies

Compiler Design...

TIME LEFT -
  • Question 1
    1 / -0

    Consider the following grammar:

    S → XYZ

    Y.val  = X.val

    Y.val = S.val

    Y.val = Z.val

    Above grammar is

  • Question 2
    1 / -0

    Which of the following statement is false?

  • Question 3
    1 / -0

    Consider the grammar with the following translation rules and X as the start symbol.

    X -> X1* Y      {X.value = X1.value * Y.value}

    X -> Y              {X.value = Y.value}

    Y -> Y1- Z       {Y.value = Y1.value - Z.value}

    Y -> Z              {Y.value = Z.value}

    Z -> digit          {Z.value = digit.value}

    What is the value for the root of the parse tree for the expression: 54 – 5 * 1 * 7 – 4?

  • Question 4
    1 / -0

    Which of the following statement is/are true?

    I. Every L-attributed definition is S-attributed

    II. Every S-attributed definition is L-attributed

    III. Both L-attributed and S-attributed can be used interchangeably

  • Question 5
    1 / -0

    Consider the following grammar:
    S → pAS | r
    A → q

    Find the number of reduction steps taken by a bottom-up parser while accepting the string "pqpqpqpqr"?

  • Question 6
    1 / -0

    Le the two productions be P → CD and P → AB. Consider the following rules.

    Rule 1: P.i = C.i + D.i and C.i = D.i - 1

    Rule 2: A.i = P.i * 2 and  B.i = A.i + P.i

    Each of the five non-terminals P, A, B, C, and D has two attributes: s is a synthesized attribute, and i is an inherited attribute. 

    Which one of the following is true?

  • Question 7
    1 / -0

    Consider the below-given Syntax Directed Translation Scheme

    B → aBA          print(“^”);

    B → a               print(“$”);

    A → b              print(“#”);

    What is the output printed by a bottom-up parser, for the input aaaabbb?

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 7

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
Submit Test
Selfstudy
Selfstudy
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now