I got a lot done this week! I have a working intermediate code generator and virtual machine, basically the code can be compiled and ran. I still have more to implement, specifically functions, but so far I have variables (numbers or strings as data types), assignment statements, and decision structures. The 'else' statement isn't implemented yet, but I have the framework for code generation done so the rest will be easier. Here is some example of code that would compile correctly:
num a = 100;
num b = 20;
a = a + 5 * b;
if ( a == 200 )
{
b = 50;
}
The result would be, a = 200 and b = 50. I also implemented complex conditional statements such as:
if ( a == 50 & b == 20 | ((c == 56 & d == 23) | e == 10) )
By next week I hope to have full decision structures done and some simple functions working (no return type or parameters)
No comments:
Post a Comment