Okay, everybody, it's the moment of truth.
We've worked very hard to implement the bodies and the structures.
Now we can finally test to see if our new structure implementation works.
So let's convert this body to a structure.
So we're going to say Struck Dog.
And once you've done that, remember a semicolon as well.
We're going to say make clean and make.
And now we're just going to do Maine we can see it works everything compiled file it says yes that's
absolutely fine.
So what we're going to do, we are now going to put some break points so that we can examine the structure
that we've parsed.
So in part structure union buy here line 1047.
It might be different for you.
We're going to put a breakpoint so i'm going to go gdb main break paths dot c and i'm going to drop
i'm going to break on 147 just after the s u notice popped off.
I'm going to go run now.
I can go print asterisk as you note and we can see the type is set correctly.
We're going to do underscore struct and we're going to get rid of the asterisk and look what we see.
A name of dog, it has a body node and the variable declaration is null because we didn't do anything
like this.
So that's pretty -- good.
I'm happy with that.
We can check our body node as well.
We'll have to do an asterisk with that one and we can see we have a body node successfully done.
That's good.
We can do an underscore body here and get rid of the asterisk.
Non underscore body.
So just a normal body.
And what do we see?
We see a statements factor.
We can see the size of that body is eight, it's not padded and we see the largest variable node.
So you can see how all of this is coming together.
Right.
You know, finally it's paying off all the hard work you're doing.
You know, I appreciate it's difficult.
So, yeah, that works pretty well.
So congratulations.
You successfully implemented the structures.
In the next lecture, we're going to test some of our error mechanisms to make sure that they are working
correctly when it comes to things such as declare and structures like what happens if there's no semicolon?
Do our errors work as expected?