Time Left - 15:00 mins

Compiler Rapid Quiz - 2 (App update required to attempt this test)

Attempt now to get your rank among 552 students!

Question 1

Find the regular expression that correctly identifies the variable name in C program

Question 2

Find the minimum number of temporary variable which is used to represent the following 3 address code in the optimized manner ?
T1=a+b
T2=T1+c
T3=T1*T2
T4=2*T3
T5=T4+d
T6=T5+T4

Question 3

Consider the following grammar :

S-> aAb | Sc

A-> d | Sd | S

The above grammar is?

Question 4

Which of the following are the viable prefixes for the input string as "aabb" with the following grammar -
S -> AA
A -> aA / b


i. aa
ii. abab
iii. AaA
iv. Ab
v. AA

Question 5

Consider the following statements :
S1 : Follow(V) where V is any variable , can contain symbol.
S2 : Follow(V) where V is any variable , can contain $ symbol.
S3 : First(V) where V is any variable , can contain symbol.
S4 : First(V) where V is any variable , can contain $ symbol.
Which option is correct ?

Question 6

Consider the following CFG.

How many states in SLR (1) parsing construction?

  • 552 attempts
  • 5 upvotes
  • 6 comments
Nov 21GATE & PSU CS