comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: GNAT ASIS & pragmas
Date: Fri, 08 Jun 2018 15:58:21 +0100
Date: 2018-06-08T15:58:21+01:00	[thread overview]
Message-ID: <ly8t7p72b6.fsf@pushface.org> (raw)
In-Reply-To: lyh8md7khh.fsf@pushface.org

Simon Wright <simon@pushface.org> writes:

> In ASIS2XML[1] and gnat2xml, I see that the repreentation of pragmas
> in GNAT ASIS doesn't follow the ARM syntax (2.8(2))[2],
>
>    pragma ::= 
>       pragma identifier [(pragma_argument_association
>                           {, pragma_argument_association})];
>
> Instead, I see for example
>
> ASIS2XML:
>       <restrictions_pragma>Restrictions
>       <pragma_argument_association>
>         <identifier>No_Exception_Propagation</identifier>
>       </pragma_argument_association></restrictions_pragma>

I should add, I can quite see the reason for ASIS to distinguish all the
different kinds of pragma, but the thinking behind ASIS2XML is to make
it possible to use XML tools to analyse source code without knowing the
fine details of ASIS, and retaining distinctions like this necessary for
(at any rate, made in) ASIS won't help.

Current thoughts on a suitable output:

      <pragma kind="restrictions">
        <identifier>RestriCtions</identifier>
        <pragma_argument_association>
          <identifier>No_Exception_Propagation</identifier>
        </pragma_argument_association>
      </pragma>

(note the weird casing in the pragma identifier, from the source).

      reply	other threads:[~2018-06-08 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  8:25 GNAT ASIS & pragmas Simon Wright
2018-06-08 14:58 ` Simon Wright [this message]
replies disabled

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