i'm so glad that ask my first question on my favorite site.

Infact i ran into multiple choice question in recent exam on Compiler Course. Suppose T1, T2 is created with SLR(1) and LALR(1) for Grammar G. if G be a SLR(1) Grammar which of the following is TRUE?

a) just T1 has meaning for G.

b) T1 and T2 has not any difference.

c) total Number of non-error element in T1 is lower than T2

d) total Number of error element in T1 is lower than T2

My solution:

we know table size and state of LALAR(1) and SLR(1) is the same. but someone say number of reduced state in LALAR(1) is lower than SLR(1) (free space in LALR(1) is more than SLR1(1) because using lookahead instead of follow) and so (d) is correct. but in answer sheet we see (b) is correct. anyone can describe it for us? which of these is true?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.