comp.lang.ada
 help / color / mirror / Atom feed
* Any Ada source XML serialization standard?
@ 2012-04-06 17:54 Yannick Duchêne (Hibou57)
  2012-04-06 19:01 ` Peter C. Chapin
  0 siblings, 1 reply; 5+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-04-06 17:54 UTC (permalink / raw)


In the search of the best ways to disconnect source representation and  
source storage, which is required to leave the stone‑age era we still live  
in (heavy words, I know), I am seeking for a standard XML representation  
for various languages, as XML (possibly its binary variant) seems the most  
obvious choice, because good enough and standard, at least to me.

I read about a so called cppML, whose purpose was precisely that, but for  
C++. As there use to be a cppML, I naively searched for an adaML or some  
sort of that, but failed. By the way, this cppML seems dead, or am I wrong?

Any known Ada source XML serialization standard in the place? Preferably a  
unique and single standard :-P

With thanks, and wish you to enjoy a nice day.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



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

* Re: Any Ada source XML serialization standard?
  2012-04-06 17:54 Any Ada source XML serialization standard? Yannick Duchêne (Hibou57)
@ 2012-04-06 19:01 ` Peter C. Chapin
  2012-04-06 21:41   ` Simon Wright
  2012-04-07 14:54   ` Yannick Duchêne (Hibou57)
  0 siblings, 2 replies; 5+ messages in thread
From: Peter C. Chapin @ 2012-04-06 19:01 UTC (permalink / raw)


On 2012-04-06 13:54, Yannick Duchêne (Hibou57) wrote:

> I read about a so called cppML, whose purpose was precisely that, but
> for C++. As there use to be a cppML, I naively searched for an adaML or
> some sort of that, but failed. By the way, this cppML seems dead, or am
> I wrong?

I wonder if one could hijack ASIS for this purpose. That is, define an 
XML representation of Ada source using XML elements with names that 
correspond to ASIS elements. Such an approach might allow a certain 
amount of "mindshare" between the two systems. A person familiar with 
ASIS could easily understand the XML representation or visa-versa.

Peter



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

* Re: Any Ada source XML serialization standard?
  2012-04-06 19:01 ` Peter C. Chapin
@ 2012-04-06 21:41   ` Simon Wright
  2012-04-07 14:54   ` Yannick Duchêne (Hibou57)
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Wright @ 2012-04-06 21:41 UTC (permalink / raw)


"Peter C. Chapin" <PChapin@vtc.vsc.edu> writes:

> On 2012-04-06 13:54, Yannick Duchêne (Hibou57) wrote:
>
>> I read about a so called cppML, whose purpose was precisely that, but
>> for C++. As there use to be a cppML, I naively searched for an adaML or
>> some sort of that, but failed. By the way, this cppML seems dead, or am
>> I wrong?
>
> I wonder if one could hijack ASIS for this purpose. That is, define an
> XML representation of Ada source using XML elements with names that
> correspond to ASIS elements. Such an approach might allow a certain
> amount of "mindshare" between the two systems. A person familiar with
> ASIS could easily understand the XML representation or visa-versa.

http://www.mckae.com/avatox.html
http://gnat-asis.sourceforge.net/pmwiki.php/Main/ASIS2XML



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

* Re: Any Ada source XML serialization standard?
  2012-04-06 19:01 ` Peter C. Chapin
  2012-04-06 21:41   ` Simon Wright
@ 2012-04-07 14:54   ` Yannick Duchêne (Hibou57)
  2012-04-09 21:25     ` Manuel Collado
  1 sibling, 1 reply; 5+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-04-07 14:54 UTC (permalink / raw)


Hi Peter,

Le Fri, 06 Apr 2012 21:01:46 +0200, Peter C. Chapin <PChapin@vtc.vsc.edu>  
a écrit:

> On 2012-04-06 13:54, Yannick Duchêne (Hibou57) wrote:
>
>> I read about a so called cppML, whose purpose was precisely that, but
>> for C++. As there use to be a cppML, I naively searched for an adaML or
>> some sort of that, but failed. By the way, this cppML seems dead, or am
>> I wrong?
>
> I wonder if one could hijack ASIS for this purpose. That is, define an  
> XML representation of Ada source using XML elements with names that  
> correspond to ASIS elements. Such an approach might allow a certain  
> amount of "mindshare" between the two systems. A person familiar with  
> ASIS could easily understand the XML representation or visa-versa.

ASIS adds interpretation, while an XML representation of Ada source should  
not. There are, in the Ada language, some intentional ambiguities, like  
the famous one which allow to write the same way, a function invocation  
and a reference to an array element. It's a long time I did not play with  
ASIS, however if my mind is right, for ASIS, “E (F)” is not same when E is  
a function or an array.

Using the BNF grammars terms as found in the RM, may not always be OK for  
the same reasons (as the terms refers to interpretations), while it seems  
to be the best starting point. If the RM could explicitly point  
intentional ambiguities and provides names for these intentionally  
ambiguous source constructs, this would be an aid.

The purpose is to get ride of formating (would be automatically applied by  
the view depending on user own preferences) and to be able to easily  
access to source as structured data. With the addition of XML namepaces to  
be able to add meta‑data more handily than with bloated comments and  
mini‑languages in comments, to allow filtered view, outlining, and other  
things, and my favorite one: cross references between sources and  
documentations.

This is language neutral, there is no complaints about Ada here ;) Just  
that such a standard would be welcome and would not cost too much I  
believe.

If you forgive me a bit of out‑of‑topic for an Ada Usenet, here are the  
readings I could find on the topic:

[Source Code Files as Structured  
Documents](http://www.sdml.info/papers/iwpc02.pdf)
[Towards Portable Source Code Representations Using  
XML](http://www.sdml.info/library/Mamas00.pdf)

There was a now abandoned close research area, named Intentional  
Programming. But this differs in many points and the above is far less  
specific.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



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

* Re: Any Ada source XML serialization standard?
  2012-04-07 14:54   ` Yannick Duchêne (Hibou57)
@ 2012-04-09 21:25     ` Manuel Collado
  0 siblings, 0 replies; 5+ messages in thread
From: Manuel Collado @ 2012-04-09 21:25 UTC (permalink / raw)


El 07/04/2012 16:54, Yannick Duchêne (Hibou57) escribió:
> Hi Peter,
>
> Le Fri, 06 Apr 2012 21:01:46 +0200, Peter C. Chapin <PChapin@vtc.vsc.edu> a
> écrit:
>
>> On 2012-04-06 13:54, Yannick Duchêne (Hibou57) wrote:
>>
>>> I read about a so called cppML, whose purpose was precisely that, but
>>> for C++. As there use to be a cppML, I naively searched for an adaML or
>>> some sort of that, but failed. By the way, this cppML seems dead, or am
>>> I wrong?
>>
>> I wonder if one could hijack ASIS for this purpose. That is, define an
>> XML representation of Ada source using XML elements with names that
>> correspond to ASIS elements. Such an approach might allow a certain
>> amount of "mindshare" between the two systems. A person familiar with
>> ASIS could easily understand the XML representation or visa-versa.
>
> ASIS adds interpretation, while an XML representation of Ada source should
> not. There are, in the Ada language, some intentional ambiguities, like the
> famous one which allow to write the same way, a function invocation and a
> reference to an array element. It's a long time I did not play with ASIS,
> however if my mind is right, for ASIS, “E (F)” is not same when E is a
> function or an array.
>
> Using the BNF grammars terms as found in the RM, may not always be OK for
> the same reasons (as the terms refers to interpretations), while it seems
> to be the best starting point. If the RM could explicitly point intentional
> ambiguities and provides names for these intentionally ambiguous source
> constructs, this would be an aid.
>
> The purpose is to get ride of formating (would be automatically applied by
> the view depending on user own preferences) and to be able to easily access
> to source as structured data. With the addition of XML namepaces to be able
> to add meta‑data more handily than with bloated comments and mini‑languages
> in comments, to allow filtered view, outlining, and other things, and my
> favorite one: cross references between sources and documentations.
>
> This is language neutral, there is no complaints about Ada here ;) Just
> that such a standard would be welcome and would not cost too much I believe.
>
> If you forgive me a bit of out‑of‑topic for an Ada Usenet, here are the
> readings I could find on the topic:
>
> [Source Code Files as Structured
> Documents](http://www.sdml.info/papers/iwpc02.pdf)
> [Towards Portable Source Code Representations Using
> XML](http://www.sdml.info/library/Mamas00.pdf)
>
> There was a now abandoned close research area, named Intentional
> Programming. But this differs in many points and the above is far less
> specific.

I've worked in the area of representing source code as XML for years. 
Please see:

   http://lml.ls.fi.upm.es/~mcollado/emu-code/emu-code-other.html

(a bit outdated, but probably still a useful compilation)

IMHO, there is no such thing as "the standard" XML representation of code 
for a given programming language. A naive approach would be to mimic the 
usual grammar of the language (if there is one). But to be useful, the 
chosen representation should take into account its intended usage (code 
navigation, automatic transformation, manual editing, etc.)

In some cases, representing the syntax is not enough. Some semantic 
information can also be included in the representation. For instance, the 
Intentional Programming approach includes also references from each 
identifier usage to the identifier definition, so overloaded symbols are 
explicitly disambiguated.

Even in the simple code formatting task you mention, some semantic 
distinction can be useful. For instance, function_F(x,y,z) and 
array_A(x,y,z) could be formatted differently, as well as distinguishing 
local and global identifiers with different color by a syntax highlighter 
for code browsing purposes.

Hope this helps.
-- 
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado




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

end of thread, other threads:[~2012-04-09 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-06 17:54 Any Ada source XML serialization standard? Yannick Duchêne (Hibou57)
2012-04-06 19:01 ` Peter C. Chapin
2012-04-06 21:41   ` Simon Wright
2012-04-07 14:54   ` Yannick Duchêne (Hibou57)
2012-04-09 21:25     ` Manuel Collado

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