comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: ANNOUNCE: Avatox 1.0 is now available
Date: Thu, 24 Aug 2006 07:03:41 +0100
Date: 2006-08-24T07:03:41+01:00	[thread overview]
Message-ID: <m264giacw2.fsf@grendel.local> (raw)
In-Reply-To: OA6Hg.840$bM.366@newsread4.news.pas.earthlink.net

"Marc A. Criley" <mcNOSPAM@mckae.com> writes:

> Simon Wright wrote:
>> I took the view that <A_DEFINING_NAME/> would look better as
>> <defining_name/> throughout.
>
> I try to adopt the prevailing style and idioms of a given programming
> or similar such language, hence the camelBack no underscore approach.

Not so sure there is a prevailing sytle or idiom for XML!

>> There are also some interesting choices about which aspects to map
>> into attributes and which into child elements, and indeed on the whole
>> mapping to be used.
>
> Basically, I mapped literals into attributes, like identifiers,
> operators, numbers, and such.

I thought traits were particularly interessting:

   --  Traits (see Asis spec) are an additional classification
   --  mechanism that lets Asis use fewer high-level elements. Not
   --  every A_Definition element supports traits, and not every trait
   --  is applicable in all circumstances. This code assumes that the
   --  Asis tree is well-formed, so if a trait is present it is legal
   --  and we just add the corresponding attribute to the DOM tree.
   procedure Add_Trait (K : Asis.Trait_Kinds; To : DOM.Core.Node) is
   begin
      case K is
         when Asis.Not_A_Trait | Asis.An_Ordinary_Trait => null;
         when Asis.An_Aliased_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "aliased", "true");
         when Asis.An_Access_Definition_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "access", "true");
         when Asis.A_Reverse_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "reverse", "true");
         when Asis.A_Private_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "private", "true");
         when Asis.A_Limited_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "limited", "true");
         when Asis.A_Limited_Private_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "limited", "true");
            DOM.Core.Elements.Set_Attribute (To, "private", "true");
         when Asis.An_Abstract_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "abstract", "true");
         when Asis.An_Abstract_Private_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "abstract", "true");
            DOM.Core.Elements.Set_Attribute (To, "private", "true");
         when Asis.An_Abstract_Limited_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "abstract", "true");
            DOM.Core.Elements.Set_Attribute (To, "limited", "true");
         when Asis.An_Abstract_Limited_Private_Trait =>
            DOM.Core.Elements.Set_Attribute (To, "abstract", "true");
            DOM.Core.Elements.Set_Attribute (To, "limited", "true");
            DOM.Core.Elements.Set_Attribute (To, "private", "true");
      end case;
   end Add_Trait;

> There are other possibilities, but I didn't want to have to maintain
> any kind of info stack to know what value to associate with a previous
> or subsequent element.  Like A_CLAUSE could've had the kind of
> clause--"with", "usePackage"--as an attribute.  Here it's all done in
> a single pass with no look back or look-ahead.

I suppose that depends on your XML-generation toolset. But I don't
think you need to worry about what to associate, just suppress the
<A_CLAUSE/> element and output an <A_WITH_CLAUSE/> (or whatever).

>> Do you think there'd be a future in offering at least the concept to
>> the ASIS team?
>
> I'm a little unclear on what concept you're referring to...an XML
> definition for Ada?

I meant that ASISWG might be interested in 'sponsoring' a schema
definition working party (as informal as you like!). After all, at the
moment we have your schema and mine, each with advantages and
disadvantages, and on my side at least suffering from blind spots; for
example, it was only on comparing the two utilties' output that I
realised I'd completely forgotten about context clauses!

--S



  reply	other threads:[~2006-08-24  6:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-17  0:58 ANNOUNCE: Avatox 1.0 is now available Marc A. Criley
2006-08-17  2:10 ` Jeffrey Creem
2006-08-18  8:03 ` Pascal Obry
2006-08-18  8:04 ` Pascal Obry
2006-08-18  8:05 ` Pascal Obry
2006-08-21 20:59 ` Simon Wright
2006-08-24  0:41   ` Marc A. Criley
2006-08-24  6:03     ` Simon Wright [this message]
2006-08-25  1:15       ` Marc A. Criley
2006-09-06 23:29       ` Randy Brukardt
2006-09-07 20:46         ` Simon Wright
2006-09-08  2:40           ` Randy Brukardt
2006-09-08 13:40             ` Georg Bauhaus
2006-09-09  8:28               ` Manuel Collado
2006-09-09 12:21                 ` Simon Wright
2006-09-11  7:58                   ` Manuel Collado
2006-09-09 18:56                 ` Marc A. Criley
2006-09-11  8:10                   ` Manuel Collado
replies disabled

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