hw3 - " Problem 1. (20) ! , "$ &)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: " Problem 1. (20) ! , "$ &) $jm: Homework 3 for Problem Solving (Due: 4/15 ( { Grammar 9L 4@!"* SLR(1) parser ! j )) % UW A B F ollow() set sv!"* SLR(1) grammar " % m} (b) $ grammar " LR(1) ' " {| ' !"$cf. (5) (c) Shift-Reduce Parsing 9L) left-recursive !~ grammar " $!~ " , - !"$cf (Hint: c recognize !" right-recursive grammar $ !"* Shift/Reduce Parsing !| CK " ?@ _f$cf. % # { BK % 2@ c im sv, m input parsing !" - )03 $ $ CK $ "? ). (5) (d) $ production SLR(1) grammar " $2L !"&*/ A B production )01 2L "tv) # !" "? U ). "? (5) {| ' !"$cf. (5) (a) LR(0) start state S0 S S Aa Bb A Ac B Bc ! j ! j % \h&*UW !~ ". " Problem 2. (30) ! $% 9L " dangling-else :L "' " S0 S S iEtS S iEtSeS Sa Eb ! ! ! ! ambiguous grammar G 9L 4@!"* " !"$cf. (a) LR(1) DFA % UW start state im ') breath- rst )im "- !"$cf (5). (b) State merge !"* LALR(1) DFA % \h$cf. (5). (c) $ LR(1) DFA LALR(1) DFA 9L) S i E t S S i E t S e S % lm!| !" state | " ?@" parsing table row % \h$cf. (5) (d) $ LALR(1) parsing table row 9L) con ict "' entry 9L 4@!"* dangling else " innermost if 9L bound $\f action . HK !"$cf (5). (e) (d) 9L) outermost if 9L bound $\f action . HK !"UW $ G language :L4@im parse !"$ !| 9M ) _f$$cf (5). (f) (e) . HK LR(1) parsing table 9L , !| "im G language parse !" $ {| ' !"UW , - !"$cf (5). ! ! ...
View Full Document

This note was uploaded on 02/22/2011 for the course ECE 4 taught by Professor Moon during the Spring '04 term at Seoul National.

Ask a homework question - tutors are online