Hello and welcome, everybody.
And in this lecture we're going to implement dual loops.
So let's head back to Compiler H, we're going to go to our statements and we're going to say struct
do well statement, do well statement.
So what do I do while statement take it takes an expression node and a body node and that is it, you
know, do while condition conditions are expression.
This is the body.
So once we've created that, let's head to the sea and just above our paths.
Well, we're going to say void paths to.
Well.
So we're going to say expect keyword do size tw var size equals zero parse body ampersand var size history
struct node body node equals node pop.
So you know, because if we do a dual look, you can see so we have our do which we expect here.
Then we have our body which is here.
And then finally we have our expression at the bottom.
So that's why we're doing this pause, keyword, parenthesis, expression, and we're going to do while
struct node expression, node equals no pop.
And finally, we need to expect the symbol for the semicolon.
So yeah, we're just going to do, make do while node and we're going to pass in the body node and the
expression node.
So let's head to node C void make do while node strike node body node struck node expression node no
create ampersand struct node so type equals node type statement do while dot statement dot dual statement
dot body node equals body node dot statement dot dual statement expression node equals expression node.
Yeah, that that should be it.
So now we're going to copy and paste this into the header file, as we usually do.
And we'll just put it under.
Make one note.
And then we're going to go to our past keyword and we're going to say LCF as equal token as file do
pause, do while history.
So now we're going to try a make clean and make everything works.
Go to test start c.
I'm going to change this to a do and i change this to a while one.
Let's see if that works.
Everything compiled.
So I think now we have implemented the if statements, the LCF statements, the for loops, the while
loops.
So I think we just need to do the switch now and then we are done for those conditional statements.
So congratulations for following this lecture successfully.