comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Dynamic Variant Record Creation
Date: Tue, 16 Mar 2010 19:31:45 +0100
Date: 2010-03-16T19:31:46+01:00	[thread overview]
Message-ID: <4b9fce92$0$6730$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <Xns9D3D861E55DA0WarrensBlatherings@188.40.43.213>

Warren schrieb:

>     procedure Get_Token(Object : in out Lexer; Token : out Token_Unit) is
>                         
>         procedure Emit_Token(T : Token_Type) is
>             T : Token_Type := Token_Type'Val(Character'Pos(Ch));
>         begin
>             Token := ( Token => T );
>         end;
> 
>         ...         
>         
>     end;


> In the above, I need to create a Token_Unit from             
> a single character (there is no "id" in this case). The values 
> of operator characters are carefully coordinated in the Token_Type 
> using a representation clause (just FYI).

This text appears to be GNATable:

      procedure Emit_Token(T : Token_Type) is
         Some_T : Token_Type := Token_Type'Val(Character'Pos(Ch));
         subtype Result_Type is Token_Unit (Token => Some_T);
         Result : Result_Type;
      begin
         -- Token := ( Token => T );



         Token := Result;
      end;

> But the issue is this:     
> 
> *.adb:339:33: value for discriminant "token" must be static

Is this true?



  reply	other threads:[~2010-03-16 18:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:11 Dynamic Variant Record Creation Warren
2010-03-16 18:31 ` Georg Bauhaus [this message]
2010-03-16 18:57 ` Adam Beneschan
2010-03-16 20:01   ` Warren
2010-03-16 20:09     ` Jeffrey R. Carter
2010-03-16 20:24       ` Warren
2010-03-16 20:40         ` Robert A Duff
2010-03-16 20:44           ` Warren
2010-03-16 20:31     ` Robert A Duff
2010-03-16 20:59       ` Warren
2010-03-16 21:55         ` Jeffrey R. Carter
2010-03-17 14:40           ` Warren
2010-03-18 12:57           ` Warren
2010-03-16 21:58         ` Robert A Duff
2010-03-17 14:22           ` Charmed Snark
2010-03-17 14:49             ` Robert A Duff
2010-03-17 16:30               ` Warren
2010-03-16 21:15       ` Adam Beneschan
2010-03-16 23:24       ` Adam Beneschan
2010-03-16 20:15   ` Robert A Duff
2010-03-16 21:00     ` Warren
2010-03-16 23:39   ` Randy Brukardt
2010-03-16 23:43     ` Randy Brukardt
2010-03-17  0:15     ` Robert A Duff
2010-03-17 14:28       ` Warren
2010-03-18  0:02       ` Randy Brukardt
2010-03-17  4:20     ` Adam Beneschan
2010-03-18  0:13       ` Randy Brukardt
2010-03-18 13:00         ` Warren
replies disabled

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