Time Left - 10:00 mins

GATE 2020 : Compiler Quiz 3

Attempt now to get your rank among 363 students!

Question 1

Consider the following translation scheme.
S ER
R *E {print (‘*’);}R|ε
E F + E {print (‘+’);}|F
F (S)|id {print (id.value);}
Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input '2 * 3 +4', this translation scheme prints

Question 2

Identify the type of error (earliest phase) identified during compilation of the following program.
#include<stdio.h>
main()
{
int gate, exam, rank;
gate= exam= rank=10.3;
printf (“ %c”, gate);
}

Question 3

CSG can be defined by .

Question 4

Consider the following SDT
GA-T{Print “-”}
AEa {Print “*”}
EEb {Print “+”}
E {Print “0”}
TEb {Print “1”}
In the SDT uses L-attribute definition, what is the output printed for evaluation of an input string “ba-bb”?

Question 5

In a bottom-up evaluation of a syntax directed definition, inherited attributes can

Question 6

In a bottom up evaluation of a syntax directed definition, inherited attributes can

  • 363 attempts
  • 1 upvote
  • 1 comment
Apr 10GATE & PSU CS