in Compiler Design edited by
1,405 views
1 vote
1 vote
Assume X,Y,Z represents the number of unfilled entries in the LR(0),SLR(1) and LR(1) table respectively.A common grammar G have been successfully parsed by all the three mentioned parsers.what is the relation over X,y and Z?

A)X ≤ Y ≤ Z

B)X = Y = Z

C)X ≥ Y ≤ Z

D)X < Y < Z
in Compiler Design edited by
1.4k views

2 Comments

The LR(0) parsing table has fewer number of blank spaces, (because it writes reduce moves blindly) than both LALR and SLR parsing tables, thereby making LR(0) parsers occupy the last position when comparing with the other two.

Also, LALR parser may do some additional (harmless) reductions, so number of blank spaces increases even more.

Hence, LALR(1) > SLR(1) >> LR(0)

Another approach to question: Use Error detection capability of each parser. 

Less number of blank entires, higher the error detection.

For error detection: https://gateoverflow.in/351/among-slr-and-lalr-which-parser-going-detect-error-faster-and

0
0
You've to mention the test-series name from where you took this question
0
0

Please log in or register to answer this question.