Question

24. State if the following grammar rules as a group passes the pairwise disjointness test and tell why or why not? (4 pts)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
 

The Pairwise disjoint test is used to check whether a grammar is LL grammar or not. The test is used to determine whether the RHS can be chosen using single token. If the grammar fails the pairwise disjoint test then the grammar cannot be used to create a top-down parser with one lookahead. For checking whether a grammar rule follows the pairwise disjointness test we need to find the FIRST for each production and if the answers are disjoint then the production passes the test.

a) For A -> aB|eAb|cBb

FIRST(aB) = a

FIRST(eAb) = e

FIRST(cBb) = c

This answers don't intersect and hence passes the test.

b) For B->dB|c

FIRST(dB) = d

FIRST(c) = c

This answers don't intersect and hence passes the test.

 
Add a comment
Know the answer?
Add Answer to:
24. State if the following grammar rules as a group passes the pairwise disjointness test and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT