From: Ben Hocking <benjaminhocking@gmail.com>
Subject: Having problem with SPARK Ada complaining that 'No EXPRESSION can start with reserved word "OTHERS".'
Date: Thu, 14 Jun 2012 05:43:42 -0700 (PDT)
Date: 2012-06-14T05:43:42-07:00 [thread overview]
Message-ID: <a3be9ddf-413a-475d-839c-6994473df43a@googlegroups.com> (raw)
The following is a simple test program to demonstrate the issue.
test.ads:
====
package Test is
type QState is (Off, On, Both);
subtype Z4 is Integer range 0 .. 3; -- 0, 1, 2, or 3
type Ensemble is array (Z4) of QState;
procedure Foo;
end Test;
====
test.adb:
====
package body Test is
procedure Foo
is
SomeQState : Ensemble := (others => Off);
begin
null;
end Foo;
end Test;
====
When I use SPARK->Examine File (from GPS), I get the following message:
4:33 Syntax Error No EXPRESSION can start with reserved word "OTHERS".
I get the same error if I type "spark test.adb" from the terminal window (I'm on Mac OS X 10.6.8).
I know this is valid Ada, because this compiles without issue:
gcc -c -g -gnatQ -gnato -fstack-check -g test.adb
I've tried this with both SPARK95 and SPARK2005. I'm using the AdaCore tool chain. The version information for SPARK is:
$ spark -version
*******************************************************
Examiner GPL 2011
Copyright (C) 2011 Altran Praxis Limited, Bath, U.K.
*******************************************************
Any help would be appreciated!
next reply other threads:[~2012-06-14 17:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 12:43 Ben Hocking [this message]
2012-06-14 13:37 ` Having problem with SPARK Ada complaining that 'No EXPRESSION can start with reserved word "OTHERS".' Phil Thornley
2012-06-14 13:49 ` Ben Hocking
2012-06-14 21:48 ` roderick.chapman
2012-06-14 13:41 ` Ludovic Brenta
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox