ASIS2XML

ASIS is the Ada Semantic Interface Specification; see http://www.acm.org/sigada/WG/asiswg/.

This program converts a unit's ASIS representation into XML, so as to make it easier to develop transformational tools using (for example) XSLT.

There is no XML Schema as yet. The output's structure is quite close to that of ASIS, at least in overall terms; for example, an A_Defining_Name element in ASIS is represented as a <defining_name/> element in XML. In turn, ASIS's structure is that of the Ada RM.

One difference is that, for the kinds of element that have visible/private parts (normal and generic packages, tasks and protected types) the visible and private parts are enclosed in <visible_part> and <private_part> elements respectively.

Example

The source unit demo.adb,

procedure Demo (X : in out Integer) is
begin
   X := X + 1;
end Demo;

results, after using tidy, in

<?xml version="1.0" encoding="utf-8"?>
<asis>
  <compilation_unit file="/Users/simon/asis2xml/demo.adb" unit="Demo">
    <context_clauses></context_clauses>
    <unit_declaration>
      <procedure_body_declaration>
        <defining_identifier>Demo</defining_identifier>
        <parameter_specification mode="inout">
          <defining_identifier>X</defining_identifier>
          <identifier>Integer</identifier>
        </parameter_specification>
        <assignment_statement>
          <identifier>X</identifier>
          <function_call prefixed="false">
            <parameter_association>
              <identifier>X</identifier>
            </parameter_association>
            <operator_symbol>"+"</operator_symbol>
            <parameter_association>
              <integer_literal>1</integer_literal>
            </parameter_association>
          </function_call>
        </assignment_statement>
      </procedure_body_declaration>
    </unit_declaration>
    <!-- <compilation_pragmas> omitted -->
  </compilation_unit>
</asis>

This project was originally hosted on SourceForge as part of ASIS for GNAT, and releases up to 20130413 can be found there.

Copyright

This work is derived from the Node_Trav component of Display_Source, which used to be distributed as a part of the ASIS implementation for GNAT and is Copyright (c) 1995-1999, Free Software Foundation, Inc. The original work in the program is Copyright (c) Simon Wright .

Licensing

The work is distributed under the terms of the GPL.

Download

here ...

Prerequisites

Building & Use

See the file INSTALL in the distribution.


Simon Wright