This new version allows the use of integers. You can declare int variables and pass int values or variables to the Print operation.
I’ve also refactored the compiled to use a kind of parse tree and several phases. But now, I’m not really satisfied with the design. The classes are too strongly coupled and the parse tree is too specific I think, too many assumptions are made during the semantical analysis. But now, I don’t know how to improve that. I also think that the design and the operations will not support some more advanced adds later, I don’t know… Don’t hesitate if you have any idea or comment on the design
I’ve also made some changes to the Lexer in order to improve the performances, but nothing spectacular.
You can now compile this kind of code with Eddi :
int a = 1; string b = "asdf"; Print(1); Print("Test"); Print(a); Print(b); b = "new b"; Prinb(b);
The next changes will be to add operations on int and perhaps also the concat on two stirngs. I will see. I will also try to improve the design of the compiler if I found some ideas.
The sources are available on Github :
- The compiler, eddic : https://github.com/wichtounet/eddic/
- The virtual machine, eddivm : https://github.com/wichtounet/eddivm/
- A commons library used by the two projects : https://github.com/wichtounet/eddi-commons/
If you want to see the exact version reffered to in this subject, you can select the tag v0.2