Google Plus Logo
Twitter Logo
Facebook Logo

EDDIC 0.9 - Floating point support

I just finished working on the 0.9 version of the EDDIC Compiler.

The language does now support floating point variables. Here is an example of what can be done in EDDI now:

void main(){
   float a = 1.5;
   float b = 3.0;
   float c = a + b;
   println(c);
   c = b + 2.75;
   println(c);

   println(test(2.0888, 1.00222));

   float array[7];
   array[0] = 21.999;
}

For now, there is no interoperability between integers and floating, so you can't add an integer to a floating point or cast a floating point to an integer. Those features will be added in the 0.9.1 version. The floating point support has been implemented using the Streaming SIMD Extension (SSE) of Intel processors. This won't work on processor that doesn't include support for SSE.

Another big improvement is that the position of the tokens in the source file are now collected through the parser. When an error or a warning arises during the compilation, the precise position of the error or the warning is printed to the console.

New options are available for eddic:

  • --ast : Print the Abstract Syntax Tree representation of the source
  • --tac : Print the Three Address Code representation of the source
  • --ast-only : Only print the Abstract Syntax Tree representation of the source (do not continue compilation after printing)
  • --tac-only : Only print the Three Address Code representation of the source (do not continue compilation after printing)

And, finally, some improvements have been made to the sources of the project.

Download

You can find the compiler sources on the Github repository: https://github.com/wichtounet/eddic

The exact version I refer to is the v0.9 available in the github tags or directly as the release branch.

Comments

Comments powered by Disqus