Dan grossman dan grossman gotouncovereds a is the 2011

Info icon This 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: t $s1 abbcde$ $s1as2 bbcde$ accept S$ start 8 B 1 a 2 A b b 3 6 e c 9 S ::= aABe 7 A ::= Abc d 4 5 A ::= b B ::= d ShiOed ‘a’ and state s2 on to stack, followed ‘a’ transiTon. ShiO again. Winter 2013 29 UW CSE 401 (Michael Ringenburg) S ::= aABe A ::= Abc | b B ::= d Trace Stack Input $s1 abbcde$ $s1as2 bbcde$ $s1as2bs4 bcde$ accept S$ start 8 B 1 a 2 b A 3 b 6 e c 9 S ::= aABe 7 A ::= Abc d 4 A ::= b 5 B ::= d ShiOed ‘b’ and state s4 on to stack, followed ‘b’ transiTon. Now, reduce. Winter 2013 UW CSE 401 (Michael Ringenburg) 30 15 1/23/13 S ::= aABe A ::= Abc | b B ::= d Trace Stack Input $s1 abbcde$ $s1as2 bbcde$ $s1as2bs4 bcde$ $s1as2 bcde$ accept S$ start 8 B 1 a 2 b A 3 b 6 e c 9 S ::= aABe 7 A ::= Abc d 4 A ::= b 5 B ::= d Pop handle (b), revealing new state s2. Go there. Winter 2013 31 UW CSE 401 (Michael Ringenburg) Trace accept S ::= aABe A ::= Abc | b B ::= d e 8 9 S ::= aABe Stack Input B S$ $s1 abbcde$ a start A b c 1 2 3 6 7 A ::= Abc $s1as2 bbcde$ b d $s1as2bs4 bcde$ 4 5 $s1as2As3 bcde$ A ::= b B ::= d •  Push nonterminal on leO of reducTon (A) onto stack, transiTon on new nonterminal, and push new state. •  Each step – read an input (shiO) or produce an output (reduce). O(n), where n is input + output. Winter 2013 UW CSE 401 (Michael Ringenburg) 32 16 1/23/13 Encoding the DFA in a Table CSE341: Programming CSE341: opTmizaTons, Languages Languages •  Given these Programming and a stack containing states, a shiO- reduce parser’s DFA can be encoded in Lecture 1 Lecture 1 two tables Course Course Mechanics Mechanics –  ac5on table rows contain state and columns contain input Mto VariablecBindings and next...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern