Control Variable Assignments [message #1708165] |
Mon, 14 September 2015 06:25  |
Eclipse User |
|
|
|
Hi everyone,
I have a problem to control the values of variables. In my DSL I have a Declarationpart ("VAR"), where a variable can be declared and also assigned. In the StatementBlock of the "BEGIN" part the value of a variable can be changed or assigned. How can I recognize or control the values of the variables in such a way that the last assignment should be the current/desired one?
My first idea was to store them in a hashmap. But I was not sure how to handle it if a statement gets deleted.
Thank you in advance!
PROGRAM test;
VAR
int : a := 3;
int : b ;
ARRAY [1..4] OF int = tempArray;
BEGIN
a := 4;
b := 0;
tempArray[a] := 1;
ENDPROGRAM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|