A forum for Spin users
You are not logged in.
Pages: 1
Hello,
the select statement is inconsistent
with syntax version 6.2
from manual:
i = 8;
do
:: i < 17 -> i++
:: break
od
Could it be fixed?
With my thanks, best regards.
LZ
Offline
Maybe this is related, I get the following error when I run the following code.
active proctype P() {
int i;
select (i : 1..10);
printf("%d\n", i)
}
spin: foo.pml:3, Error: misplaced break statement
This worked with 6.1.0.
Offline
Is the following a bug? If so, is there a workaround, so I can still use the concise select statement for 2-dimensional arrays?
2-dimensional array:
typedef solt
{
byte Id;
bool Valid;
};
typedef ds
{
solt y[dimy];
};
ds x[dimx];
Now I want to use a simple select for one Id:
select (x[0].y[0].Id : 0..2);
However, the syntax check of Spin Version 6.4.6 -- 2 December 2016 says:
[quote]Error: bad index in for-construct sector[/quote]
This error does not occur if I do the translation by hand as described at http://spinroot.com/spin/Man/select.html:
x[0].y[0].BlkId = 0;
do
:: (x[0].y[0].Id < 3) -> x[0].y[0].Id++
:: break
od
Now the syntax check of Spin Version 6.4.6 -- 2 December 2016 says:
[quote]No Syntax Error.[/quote]
Offline
Pages: 1