comp.lang.ada
 help / color / mirror / Atom feed
* Asis.Text.Character_Position : inconsistency ?
@ 2010-11-07  8:04 Yannick Duchêne (Hibou57)
  2010-11-07 12:34 ` Simon Wright
  2010-11-09 14:18 ` Vadim Godunko
  0 siblings, 2 replies; 9+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-11-07  8:04 UTC (permalink / raw)


Hello Ada writers,

I was trying to patch AdaControl ( http://www.adalog.fr/adacontrol2.htm )  
so that it can build with Gela-ASIS. This is an interesting process of  
little refactorisation, as Gela-ASIS is clearly design so that it make no  
reference at all to a specific compiler implementation (it do so defining  
an Implementation_Defined_Type from which other discrete types are  
derived). After a first attempt I restarted again and felt something was  
wrong as I could not get something coherent about types.

Prior note: I do not own a copy of the ISO ASIS reference, so I cannot  
tell who of TenDRA or ISO is right or wrong.

What disturbs me, if I believe (as I feel it is) that Gela-ASIS heavily  
stick on the ASIS standard: Asis.Text defines two types,  
Character_Position and Line_Number. Character_Position is derived from  
ASIS_Natural, which in turn is derived from ASIS_Integer, which, the  
latter, is implementation defined.

Also, Asis defines a type Asis.Program_Text, which is not implementation  
defined, and which is explicitly an unconstrained subtype of the Ada's  
type Standard.Wide_String.

Shouldn't be Asis.Text.Character_Position be defined so that is can be  
used as an index in Asis.Program_Text ? This would imply  
Character_Position would be a derived from Standard.Positive, and due to  
the way Character_Position is derived, as explained above, this would  
imply the root implementation defined type, should be instead, at least  
derived from Positive or an ancestor type of Positive.

Which is wrong ? TenDRA with Gela-ASIS or the ASIS ISO reference (which I  
do not own, so I cannot check).

Comments and lightings welcome from any one owning a copy of the ASIS  
reference, so that I can figure if I should primarily patch Gela-ASIS or  
AdaControl.

With thanks



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07  8:04 Asis.Text.Character_Position : inconsistency ? Yannick Duchêne (Hibou57)
@ 2010-11-07 12:34 ` Simon Wright
  2010-11-07 19:03   ` Yannick Duchêne (Hibou57)
  2010-11-09 14:18 ` Vadim Godunko
  1 sibling, 1 reply; 9+ messages in thread
From: Simon Wright @ 2010-11-07 12:34 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> What disturbs me, if I believe (as I feel it is) that Gela-ASIS
> heavily stick on the ASIS standard: Asis.Text defines two types,
> Character_Position and Line_Number. Character_Position is derived from
> ASIS_Natural, which in turn is derived from ASIS_Integer, which, the
> latter, is implementation defined.
>
> Also, Asis defines a type Asis.Program_Text, which is not
> implementation defined, and which is explicitly an unconstrained
> subtype of the Ada's  type Standard.Wide_String.
>
> Shouldn't be Asis.Text.Character_Position be defined so that is can be
> used as an index in Asis.Program_Text ? This would imply
> Character_Position would be a derived from Standard.Positive, and due
> to  the way Character_Position is derived, as explained above, this
> would  imply the root implementation defined type, should be instead,
> at least  derived from Positive or an ancestor type of Positive.
>
> Which is wrong ? TenDRA with Gela-ASIS or the ASIS ISO reference
> (which I do not own, so I cannot check).

GNAT ASIS is pretty clear (at least from the copyright notice) that most
of the public part of package specs is from the standard.

ASIS.Text is about fragments of code -- the part of the source text
corresponding to an element -- in type Span. Line_Number is the line in
the source text, Character_Position is the position in the line.

I suspect you're supposed to use Element_Image, Line_Image etc?



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 12:34 ` Simon Wright
@ 2010-11-07 19:03   ` Yannick Duchêne (Hibou57)
  2010-11-07 19:18     ` Simon Wright
  2010-11-07 19:20     ` Simon Wright
  0 siblings, 2 replies; 9+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-11-07 19:03 UTC (permalink / raw)


Le Sun, 07 Nov 2010 13:34:56 +0100, Simon Wright <simon@pushface.org> a  
écrit:
> GNAT ASIS is pretty clear (at least from the copyright notice) that most
> of the public part of package specs is from the standard.
Gela-ASIS seems too, as the package specification they used is a raw copy  
of what you can get from there:
http://www.sigada.org/wg/asiswg/intro.html

> ASIS.Text is about fragments of code -- the part of the source text
> corresponding to an element -- in type Span. Line_Number is the line in
> the source text, Character_Position is the position in the line.
>
> I suspect you're supposed to use Element_Image, Line_Image etc?
… and Comment_Image and Non_Comment_Image and Debug_Image, Yes. But the  
source I am dealing do the assumption Character_Position is a subtype of  
Natural, and that is why I was wondering about this type definition. This  
leads into trouble when I try to build it with Gela-ASIS, because with  
Gela-ASIS, Character_Position and Line_Number are not subtypes (direct or  
indirect) of Natural.

As the packages specifications seems to be raw copy of what you get from  
the link above, I suppose TenDRA is right.

And you are right too, the accessors to be used to get text representation  
are indeed the Asis.Text.XTZ_Image. So there is no need for  
Character_Position to be a subtype of the index type of Program_Text. So  
the Asis specification is not wrong neither.

By the way, another question: do you know a link to a working draft  
version of ASIS 2005 ? (I know this can be inferred from ASIS Issues list,  
just that this would be cleaner… but I don't bother if there is none)

Thanks for your comments :)

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.

“I am fluent in ASCII” [Warren 2010]



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 19:03   ` Yannick Duchêne (Hibou57)
@ 2010-11-07 19:18     ` Simon Wright
  2010-11-07 19:35       ` J-P. Rosen
  2010-11-07 19:20     ` Simon Wright
  1 sibling, 1 reply; 9+ messages in thread
From: Simon Wright @ 2010-11-07 19:18 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> By the way, another question: do you know a link to a working draft
> version of ASIS 2005 ? (I know this can be inferred from ASIS Issues
> list,  just that this would be cleaner… but I don't bother if there is
> none)

No, sorry -- anyone else?



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 19:03   ` Yannick Duchêne (Hibou57)
  2010-11-07 19:18     ` Simon Wright
@ 2010-11-07 19:20     ` Simon Wright
  2010-11-07 20:44       ` Yannick Duchêne (Hibou57)
  1 sibling, 1 reply; 9+ messages in thread
From: Simon Wright @ 2010-11-07 19:20 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> the source I am dealing do the assumption Character_Position is a
> subtype of  Natural, and that is why I was wondering about this type
> definition. This  leads into trouble when I try to build it with
> Gela-ASIS, because with  Gela-ASIS, Character_Position and Line_Number
> are not subtypes (direct or  indirect) of Natural.

I think the source must be making unwarranted assumptions.



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 19:18     ` Simon Wright
@ 2010-11-07 19:35       ` J-P. Rosen
  2010-11-12 19:35         ` Randy Brukardt
  0 siblings, 1 reply; 9+ messages in thread
From: J-P. Rosen @ 2010-11-07 19:35 UTC (permalink / raw)


Le 07/11/2010 20:18, Simon Wright a écrit :
> "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:
> 
>> By the way, another question: do you know a link to a working draft
>> version of ASIS 2005 ? (I know this can be inferred from ASIS Issues
>> list,  just that this would be cleaner… but I don't bother if there is
>> none)
> 
> No, sorry -- anyone else?
I don't think there is a public version of the current state of the ASIS
manual (Randy will correct me if I'm wrong).

Note that there will be no ASIS 2005. Given the current lagging of ASIS
wrt Ada, ISO took the decision to skip ASIS 2005 and to issue ASIS 2012,
approximately at the same time, and then keep both in sync.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a déménagé / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 19:20     ` Simon Wright
@ 2010-11-07 20:44       ` Yannick Duchêne (Hibou57)
  0 siblings, 0 replies; 9+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-11-07 20:44 UTC (permalink / raw)


Le Sun, 07 Nov 2010 20:20:40 +0100, Simon Wright <simon@pushface.org> a  
écrit:

> "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:
>
>> the source I am dealing do the assumption Character_Position is a
>> subtype of  Natural, and that is why I was wondering about this type
>> definition. This  leads into trouble when I try to build it with
>> Gela-ASIS, because with  Gela-ASIS, Character_Position and Line_Number
>> are not subtypes (direct or  indirect) of Natural.
>
> I think the source must be making unwarranted assumptions.
But the compiler did not reject anything ;) So the responsibility must be  
shared with the underlying ASIS library too (remember, Ada is strongly  
typed, if there was no issue with ASIS-for-GNAT too, this could not even  
compile with this one)


-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.

“I am fluent in ASCII” [Warren 2010]



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07  8:04 Asis.Text.Character_Position : inconsistency ? Yannick Duchêne (Hibou57)
  2010-11-07 12:34 ` Simon Wright
@ 2010-11-09 14:18 ` Vadim Godunko
  1 sibling, 0 replies; 9+ messages in thread
From: Vadim Godunko @ 2010-11-09 14:18 UTC (permalink / raw)


On Nov 7, 11:04 am, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
>
> Which is wrong ? TenDRA with Gela-ASIS or the ASIS ISO reference (which I  
> do not own, so I cannot check).
>
Here is official ASIS packages specifications:

http://www.sigada.org/wg/asiswg/specs/asis20s.txt



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

* Re: Asis.Text.Character_Position : inconsistency ?
  2010-11-07 19:35       ` J-P. Rosen
@ 2010-11-12 19:35         ` Randy Brukardt
  0 siblings, 0 replies; 9+ messages in thread
From: Randy Brukardt @ 2010-11-12 19:35 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

"J-P. Rosen" <rosen@adalog.fr> wrote in message 
news:ib6v2j$lhd$1@news.eternal-september.org...
> Le 07/11/2010 20:18, Simon Wright a �crit :
>> "Yannick Duch�ne (Hibou57)" <yannick_duchene@yahoo.fr> writes:
>>
>>> By the way, another question: do you know a link to a working draft
>>> version of ASIS 2005 ? (I know this can be inferred from ASIS Issues
>>> list,  just that this would be cleaner. but I don't bother if there is
>>> none)
>>
>> No, sorry -- anyone else?
> I don't think there is a public version of the current state of the ASIS
> manual (Randy will correct me if I'm wrong).

That's right. The only way to get access to the draft ASIS is to become a 
member of the ARG. We could use some additional ASIS expertise, so that's 
not out of the question.

The SIs themselves are publicly available on www.ada-auth.org, so you can 
find out about individual changes that way.

                                     Randy.






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

end of thread, other threads:[~2010-11-12 19:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-07  8:04 Asis.Text.Character_Position : inconsistency ? Yannick Duchêne (Hibou57)
2010-11-07 12:34 ` Simon Wright
2010-11-07 19:03   ` Yannick Duchêne (Hibou57)
2010-11-07 19:18     ` Simon Wright
2010-11-07 19:35       ` J-P. Rosen
2010-11-12 19:35         ` Randy Brukardt
2010-11-07 19:20     ` Simon Wright
2010-11-07 20:44       ` Yannick Duchêne (Hibou57)
2010-11-09 14:18 ` Vadim Godunko

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