 Okay, so now we're talking about program problem three from the first practice midterm one practice practice exam So this is a little tricky because I mean does anybody really want me to go through the first and follow sets of these cameras? Okay, so what we'll do is I will start with the first and follow sets that I've recalculated for class We'll look at those make sure those are okay Okay, so yeah, we definitely know that if we want to do a parsing right we have to calculate the first and follow sets This is what you get so this is the first sets and follow sets rules I have to actually look through it just to make sure it's what we talked about, but I'm pretty sure it's what we talked about So yeah in that case, so yeah, that will be the last so if you go look at the practice exam That is the last page on the practice exam. I Think on the actual exam You'll have extra pages at the end too. So you can do stuff with as you see fit Okay, so problem three is s goes to a b c d a goes to little a big a little b a Also goes to be see B goes to little b big B D goes to epsilon C goes to little C and C goes to epsilon D goes to Okay Oh, okay, sorry, I hope so I mean, I'll post all these definitely answers on like they'll be online answers to these but Yeah, okay so I want to do this and We have already calculated the first of all of these so the first of s is a the Cd the first of a Is C epsilon First of B is the epsilon first of C little C epsilon First D is the second D And while I'm writing the next one, maybe you guys can like eyeball that to make sure it kind of makes sense Oh, okay. Yeah, follow of s is dollar sign Follow me a CD Is DBC? They're all the same This is asking you to write the parse a function of a predictive recursive descent parser for the grammar So you can assume that a function Get token is available and a function syntax error is available and also all of the other parse Non-terminals are available, right? We call parse A and C, parse D, whatever So it should also be available Questions on either Okay, so we want to write parse A So there's two rules that a can produce right a they're gonna produce little a big a or little b and little b or a is gonna produce BC So the first thing we're gonna do is to read in the token with get token Then we are going to So we want to know which one of these rules we can possibly parse right? We want to know if we're gonna parse a goes to little a big a big b or a goes to BC Right, so we want to first check The first of little a big a little p Right, so it's the first of little a big a little b. Hey, yeah, it's the second thing So we do if t underscore type Is equal to a Then we so the question is Do we put back the back the token? We call and get token that's the question So do we call it so which rule are we parsing this one, right? So because of the terminal, right? We want to actually consume that a before calling parse a again So we know we're gonna because we want to make sure that the next tokens are in a little a Followed by a parse a and followed by a little b Right, so we wanted to is we don't so if you don't want to put back the token We don't want to call and get token. Okay. Okay. Thanks for coming How long is your class? For a long time, right? If you if you get a project three questions, right? Yeah, I can shoot me an email and I'll try to help Okay, so parse a So we're gonna want to call parse a And then we need to get the next token Now and now what are we checking about this token? I believe that's what we have to go outside