Menu

#6 Representation of pragmas

(none)
closed
None
2019-04-26
2018-06-08
No

In ASIS2XML and gnat2xml, I see that the repreentation of pragmas in GNAT ASIS doesn't follow the ARM syntax (2.8(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>

gnat2xml:

      <restrictions_pragma pragma_name="Restrictions">
         <sloc line="1" col="1" endline="1" endcol="47"/>
         <pragma_argument_associations_ql>
            <pragma_argument_association>
               <sloc line="1" col="22" endline="1" endcol="45"/>
               <formal_parameter_q>
                  <not_an_element>
                     <sloc line="1" col="1" endline="0" endcol="0"/>
                  </not_an_element>
               </formal_parameter_q>
               <actual_parameter_q>
                  <identifier ref_name="No_Exception_Propagation" ref="null" type="null">
                     <sloc line="1" col="22" endline="1" endcol="45"/>
                  </identifier>
               </actual_parameter_q>
            </pragma_argument_association>
         </pragma_argument_associations_ql>
      </restrictions_pragma>

(gosh!)

I'd like to change this (well, the one I have control over, ASIS2XML) to something more natural and that corresponds better to the ARM, e.g.

   <pragma kind='restrictions' name='Restrictions'>
      <pragma_argument_association>
        <identifier>No_Exception_Propagation</identifier>
      </pragma_argument_association>
   </pragma>

(the difference between kind & name being that name is as in the source, whereas kind is lower-cased).

Discussion

  • Simon Wright

    Simon Wright - 2018-06-10
    • status: open --> pending
     
  • Simon Wright

    Simon Wright - 2018-06-10

    No one on comp.lang.ada has offered any criticism of my final offering there:

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

    so I've settled on that.

    Fixed in [4fc9c2].

     

    Related

    Commit: [4fc9c2]


    Last edit: Simon Wright 2018-06-10
  • Simon Wright

    Simon Wright - 2019-04-26
    • status: pending --> closed
     
  • Simon Wright

    Simon Wright - 2019-04-26

    Fixed in Release_20190426.

     

Log in to post a comment.

MongoDB Logo MongoDB