Back to programming again.
I decided to expand the expression parser to allow for if/while/for constructs and statement lists. Those are actually pretty straightforward, though I also thought it might be a good idea to wedge in local variable declarations, and that is a little less straightforward.
Currently an Eval() call in the parse tree is expecting a templated "result" variable of the appropriate type generated by the sub-tree of the expression at each node. I'm thinking this should just use a system stack structure of some sort - the return value just gets written above the stack pointer, and all of the local variables can then just sit below it. That makes it just a short hop to proper function definitions.
So, there's some progress there. Kerbal Space Program 0.22 was also released today, which makes it slightly more difficult to get any real work done. :)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.