Answered You can hire a professional tutor to get the answer.

QUESTION

You will need the programs from Lab2 and Lab3.Write a program that constructs the ACTION and GOTO parsetables for an SLR parser. Method for doing this isalgorithm 4.46 (Purple Dragon Book) pg 253, Alg

You will need the programs from Lab2 and Lab3.Write a program that constructs the ACTION and GOTO parsetables for an SLR parser. Method for doing this isalgorithm 4.46 (Purple Dragon Book) pg 253, Algorithm4.8 (Red Dragon Book), pg 227. Algorithm to do this isbriefly described in Feb 16 notes, Shift-Reduce parserthat uses these tables is described in Feb 9 notes.Once you have the ACTION and GOTO tables, it is easyto construct your own SLR parser.Given your program, construct the SLR parse tables forthe augmented expression grammar:S->EE->E TE->TT->T*FT->FF->iF->(E)Input format should be the same as for Lab3; define yourown output format.Report if any states contain shift-reduce or reduce-reduce conflicts.Resolve all shift-reduce conflicts (if any) in favor of shiftAnswer the questions:1> Is the given expression grammar in SLR? (Note that ifthere are shift-reduce or reduce-reduce conflicts, theanswer is NO.)2> If there were shift-reduce conflicts, your program should setthe state where the conflict occurs to SHIFT - this is what YACC does, and it works much of the time. Will this defaultaction be correct in this case (assuming the grammar was notSLR)?

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question