Hello and welcome.
And in this lecture we're going to implement go to so we'll be able to do things like go to ABC.
So we're going to implement the parsing of that today.
So head over to parse dot C and just above parse label.
We're going to say parse go to
so we're going to say expect keyword go to parse identifier history begin and that's going to be zero
and for the flags and go to expects a semicolon so we need to check for that and now we're going to
pop off the label node.
And we're going to call make go to Node and we're going to pass in the label node.
So that is the process for go to because go to will always take an identifier such as this.
Go to ABC 55, right.
So let's head over to Node C, we're going to say void, make go to node struck node label node.
We're going to say no, create ampersand struct node type equals, node type, go to statement, go
to.
And now we need to actually set the label node, but we haven't created those structures yet, so we're
going to do that now go to compiler H, search for struct underscore node.
Okay, we find this.
In the statement at the bottom we're going to say struct underscore scroll go to statement and this
will be underscore go to and here will be our label node.
And you know what?
We can just call it label S.A.C..
We're going to say dot statement, dot underscore.
Go to label equals label node.
Copy and paste this.
We're going to put it in compiler h search for make expression node pasted above the label and there
we go.
So back to parse it.
See, that function is now completed.
So we now need to go to our parse keyword function.
And down here we're going to say LCF as equal token sfl go to pars, go to an impasse in the history.
So yeah, that should be enough.
And before I forget, we really should be putting returns on all of these.
So do a return there.
Return here.
I return here.
And then down here we can just say compiler error, current process, invalid keyword, nice and simple.
And of course, don't forget the new line.
Okay, so let's do a make clean.
And I make.
Try Maine and we actually see invalid keyword.
Why do we see invalid keyword?
Because we haven't done a return for past continue or pause break.
So we need to do one for those as well.
So try that again.
We're going to say make clean, make.
And we're going to say Maine.
And then we are everything's fine.
Go to test.
See, we're going to say go to ABC.
Try it again.
Everything's fine.
Perfect.
So you've now implemented labels and go to.