|
From: Craig R. <cr...@wo...> - 2002-04-30 17:41:52
|
Yeah, I figured that one out, I wasn't setting the vm->binary and vm->binlen, which is pretty stupid since I was looking at it last night wondering how the vm is supposed to find the binary that I had compiled. Oh well, one of those late night things where I was beating myself up instead of just going to bed and starting fresh the next day. I also figured out that vm->retval isn't set to anything, and cup_new_value() isn't implemented yet. So I was wondering, what about making the vm->retval a CUPVALUE, but not a pointer to one, that way it's always there and there's no need to worry about disposing of it when the vm goes away? Anyway just a thought, I think I'm going to try to implement the functions that are described by the API that aren't there yet, since those would make it much easier to debug anything else added to the VM. Some of this stuff is kinda difficult because it's the chicken and egg thing, which brings up another question. Where's the compiler supposed to put all the variables declared in the program, I haven't gotten a complete grasp of everything in the compiler yet but do we need to implement some sort of symbol table? I know the compiler only does one pass right now, but what about doing another pass first to create the scopes and vars that go with them, and then the second pass to create the code? Hey, don't let me wear you out with this thing, I just have to throw these thoughts out there so I can digest them later. I do think for now making the vm->retval a CUPVALUE would simplify things as far as getting the VM up and working. Craig ----- Original Message ----- From: "Keith Jackson" <ke...@cr...> To: "Cup-Dev List" <cup...@li...> Sent: Tuesday, April 30, 2002 10:58 AM Subject: Re: [Cup-Dev] TODO list > Not sure what problem you are running into, but I don't -think- It's a > problem with the Cup libraries. I just broke cup into two seperate programs > cupc and cupvm and they seem to work as intended, with the proper magic > numbers and all. To see how to write your own program that embeds cup, the > cup.c cupc.c and cupvm.c files are good places to start, since that's what > they do, simply include and use the cup libraries. > > Keith > > > On Tue, 30 Apr 2002, Craig Reagan wrote: > > > Yeah, I was looked at this some more last night, figured the best way to go > > was to create a small program with cup embeded so I could use C's IO to look > > at what's going on. The API document is a little dated, nothing major, I'm > > trying to keep some notes as I go though so I can remember what needs to be > > updated. I was still having a few problems, can't figure out why > > cup_compile() seems to return a different binary in my program versus using > > the '-o' option from the cup built from CVS, thus causing the VM to say I > > have an "incorrect magic". > > > > I probably won't have much time to look at this the rest of this week > > either, but your inputs are helpful, I need to look at the compiler more > > closely if anything just to better understand how to use the debug info. > > > > Later, > > Craig > > > > ----- Original Message ----- > > From: "Keith Jackson" <ke...@cr...> > > To: "Cup-Dev List" <cup...@li...> > > Sent: Tuesday, April 30, 2002 8:10 AM > > Subject: [Cup-Dev] TODO list > > > > > > > Rather that try and use SourceForge Task tracking/assignment with such a > > > relatively small project, I've created the doc/TODO file. So, we can > > fiddle > > > around in there. As I've been going thru the code, trying to figure out > > what > > > I've finished and what I havn't, I started writing it up. There is still a > > > lot of compiler work before much VM work can be done. I believe the VM is > > a > > > good shell for now, as you said Craig. The compiler has a lot going for > > it, > > > but is still lacking in some major features outlined in the TODO. Anyway, > > > I'll see what I can do on some of that, or you can, etc. DUnno when I'll > > > have a lot of time, but I'll see what I can do. :) > > > > > > Let me know if ya have any questions, of course. > > > > > > > > > Keith > > > > > > > > > > > > > > > > > > > > |