{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L ncodes what l do given urrent state symbol eg shio

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: cs •  ObservaTon ourse Mechanics the contents of the ML Variable Bindings ML the handle are the stack prior to Variable Bindingssame as before. AOer that, new stack will contain a san Grossman ingle non- terminal. D –  Scanning the nDansGrossman uFall 2011 the same ew tack will take s through Fall 2011 transiTons up to the beginning of the handle. Then, one more transiTon for the new non- terminal. –  Can record state numbers on the stack with each symbol, and go directly to the appropriate state when we pop the handle from the stack Winter 2013 UW CSE 401 (Michael Ringenburg) 26 13 1/23/13 New Stack CSE341: Programming CSE341: Programming Languages Languages •  Change the stack to contain pairs of states and symbols from ecture 1 Lecture 1 Lthe grammar $s0 X1 s1 X2 ourse n sn Course Mechanics C s2 … X Mechanics ML –  State sMiL tVariablestate Variable Bindings 0 s he start Bindings –  When we add a symbol to the stack, push the symbol plus new FA Dan Grossman Dan Grossman state Fall 2011 Fall 2011 –  If Xi is the beginning of the handle that we reduce, popping it will reveal si- 1, which is precisely the state the FA was in prior to reading the handle. •  OpTmizaTon: in an actual parser, only the state numbers need to be pushed, since they implicitly contain the symbol informaTon (actually, items). Winter 2013 27 UW CSE 401 (Michael Ringenburg) S ::= aABe A ::= Abc | b B ::= d Trace accept Stack Input $s1 abbcde$ 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 ShiO first symbol on to stack. Winter 2013 UW CSE 401 (Michael Ringenburg) 28 14 1/23/13 S ::= aABe A ::= Abc | b B ::= d Trace Stack Inpu...
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