Closed deisekelley closed 4 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. :)
Solved
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. :)