Friday, May 12, 2006

More 'o the same.....

I've been progressing with my BASIC interpretor slightly - as I thought, its slow going since I don't have a whole lot of time at night to actually do it. Still, at least its progressing.

I changed the way my token buffer works to allow multiple "basic" classes to have its own interface into the token buffer. This should allow multiple basic threads, which is fairly cool - even if it is just interpreted. I also added a token stack to allow items to be pushed back when they aren't needed. usually I only need a single item, but I added "N" depth just in case, although its yet to be tested.

Theres something odd with this code though, as Im having trouble following it a bit, which is usually a sign that its been over engineered an too complicated for its own good. So I'll have to take a step back and see what I've done wrong. I suspect I've just added a layer I don't need, or added it in the wrong place of course.

Currently I have the main program loop doing a pre-process, an then it calls ProcessTick() once "n" times a frame - or until its time allowed runs out. The Tick then in turn calls the TokenBuffer->GetNext() which fetches the next token and value/float/string if theres one attached. This is all very well, and fairly simple, which is why I'm wondering what I've done as it appears to be a bit more complicated that that.

Oh well... I must be doing something right at work, as I was playing with templates yesterday and did something Russell quite liked. This is pretty good as it shows I'm started to get the hang of it. STL gave me another kick in the teeth as theres another hidden option that lets you switch off range checking. I wish Microsoft would add a gamers switch that lets us go nice and quick, or at the very least TELL us about it! MS spend so much time telling us that games are really important to them, then ignore us completly when doing compilers and tools, it pisses me off no end.

No comments: