Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Introduce variables on EDDI

DZone's Guide to

Introduce variables on EDDI

· Java Zone ·
Free Resource

Get the Edge with a Professional Java IDE. 30-day free trial.

The version 0.1.1 of EDDI is now available.

This new version introduce the feature to put variable on the code. You can now write things like that :

a = "Variable a";
b = "Variable b";
Print(a);
Print(b);

And you can also reassign value to a variable and assign the value of a variable to another :

a = b;
b = "New variable b"; 

Nothing extraordinary, but it’s a start. The variable name are compiled into integers and a table of variable has been made on the virtual machine.

The last step will be to introduce a new type : the integers. But for this integration, I’m not exactly sure on how to do that. I will certainly create a string pool and put only references to the strings on the stack, but it’s not clearly defined. Don’t hesitate if you have any comment :)

The project is 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.1.1

 

From http://www.baptiste-wicht.com/2011/06/introduce-variables-on-eddi/

Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}