comp.lang.ada
 help / color / mirror / Atom feed
* Having problem with SPARK Ada complaining that 'No EXPRESSION can start with reserved word "OTHERS".'
@ 2012-06-14 12:43 Ben Hocking
  2012-06-14 13:37 ` Phil Thornley
  2012-06-14 13:41 ` Ludovic Brenta
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Hocking @ 2012-06-14 12:43 UTC (permalink / 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!



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-14 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-14 12:43 Having problem with SPARK Ada complaining that 'No EXPRESSION can start with reserved word "OTHERS".' Ben Hocking
2012-06-14 13:37 ` Phil Thornley
2012-06-14 13:49   ` Ben Hocking
2012-06-14 21:48     ` roderick.chapman
2012-06-14 13:41 ` Ludovic Brenta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox