[gps-users] GPS project file can not be edited graphically

Emmanuel Briot briot at adacore.com
Mon May 30 09:30:58 CEST 2011


> My question is that why GPS does not complain declaration and initialization,
> shown below, while assignment statement is used in both cases.
>
> type OS_Kind is ("Windows_NT", "unix");
>
> OS : OS_Kind := external ("OS", "unix");

Because this is a special case of variable, referencing an external value. GPS 
treats these specially, and displays them in the Scenario view.
The reason it does not handle standard variables is that it would be difficult 
to preserve the user's project in such cases, for instance:

project Default is
     Var := "foo";

     case OS is
        when "unix" =>
           Var := "foo_unix";
        when "Windows_NT" =>
           Var := "foo_win";
     end case;
end Default;

then GPS would only see the final value of the variable based on the current 
scenario, and would not know that the user wants to 'isolate' the 'foo' part.

Since such projects cannot be created graphically anyway, we just assume the 
user knows what he is doing and will keep editing the project textually.

Emmanuel


More information about the gps-users mailing list