lives-group / APEG

2 stars 0 forks source link

Arithmetical Expressions Issue #11

Closed deisekelley closed 4 years ago

deisekelley commented 6 years ago

Hi guys,

I found a problem with the AST of expressions, i don`t know if it is the parser or the AST building process, but i runned the follow example:

/ Tests semantics of choice operator, discarding changes on environments /

apeg choiceback;

options { envSemantics = discardChangesWhenFail; }

a returns[int k] : b<0,k> ;

b[float x] returns[float x1] : '0' { x = x1 3.0 x / 2.0; } ;

And the result in the CodeGenerator for the expression update was:

env.setAt(0,((float)env.getAt(1)) / 2.0);

Then I runned the DOTGenerator that confirmed that AST was indeed missing some nodes.

I really think that we need to fix this. :)

lvsreis commented 4 years ago

Solved