Question

Write a program that constructs the ACTION and GOTO parse tables for an SLR parser. Method for doing this is algorithm 4.46 (Purple Dragon Book) pg 253 Algorithm 4.8 (Red Dragon Book pg 227 Algorithm to do this is briefly described in Feb 16 notes, Shift-Reduce parser that uses these tables is described in Feb 9 notes. Once you have the ACTION and GOTO tables it is easy to construct your own sLR parsen. Given your program, construct the SLR parse tables for the augmented expression grammar: S E- E+T E- >T T- T F T- F F- i F- (E) Input format should be the same as for Lab6; define your own output format. Report if any states contain shift-reduce or reduce-reduce conflicts. Resolve all shift-reduce conflicts (if any) in favor of shift Answer the questions 1 Is the given expression grammar in SLR? Note that if there are shift-reduce or reduce reduce conflicts the answer is NO.) 2> If there were shift-reduce conflicts, your program should set the state where the conflict occurs to SHIFT this is what YACC does, and it works much of the time will this default action be correct in this case assuming the grammar was not SLR)?

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

丁2 Le) ーゲ下5 06-06-2017 18:39

iの 06-06-2017 18:39

Program for SLR

PinteC adey the no.of leamns): Scanf I ..d , , &t) ; Cc tol ble ant (/s table C3csD: 33 prntf (In SLR TAGLE:In); en en pOP

Add a comment
Know the answer?
Add Answer to:
Write a program that constructs the ACTION and GOTO parse tables for an SLR parser. Method...
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