{
  "authors": [
    "Simon Wright"
  ],
  "build-switches": {
    "*": {
      "ada_version": "ada2022"
    },
    "development": {
      "contracts": "yes"
    }
  },
  "depends-on": [
    {
      "case(os)": {
        "...": {
          "libadalang": "^23.0.0"
        },
        "macos": {
          "gnat_external": ">=12.2.0"
        }
      }
    }
  ],
  "description": "Generates XML for Ada source, using libadalang.",
  "environment": {
    "case(os)": {
      "macos": {
        "CFLAGS": {
          "set": "-I/usr/local/include -I/opt/homebrew/include"
        },
        "LDFLAGS": {
          "set": "-L/usr/local/lib -L/opt/homebrew/lib"
        },
        "LIBRARY_TYPE": {
          "set": "relocatable"
        }
      }
    }
  },
  "executables": [
    "libadalang2xml"
  ],
  "licenses": "GPL-3.0-or-later",
  "long-description": "Libadalang2XML is a tool to extract syntatic aspects of Ada source code into XML.\n\nThe Ada source is initially read using [Libadalang](https://github.com/AdaCore/libadalang). The resulting tree is then traversed, and its structure output in an XML form.\n\nThe [document type definition](https://en.wikipedia.org/wiki/Document_type_definition) isn't explicit; it's simply derived from the tree elements created by Libadalang. Note that Libadalang includes much more semantic information than the surface structure generated by this tool, but nevertheless there's enough there to --- for example --- create a scriptable body for a package spec.\n\n## macOS ##\n\nFor reasons explained [here](https://forward-in-code.blogspot.com/2023/03/libadalang-alire-and-macos.html), the tool can't be built on macOS using Alire's `gnat_native` compiler; you need to have a full compiler suite on your `PATH`, like that obtainable for [GCC 12.2.0 (x86 64)](https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.2.0-x86_64) or [GCC 12.2.0 (aarch64)](https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.2.0-aarch64). Having set that up, `alr build` will built the tool.\n\n## Example ##\n\nAs an example of the output, this code\n``` ada\npackage Demo is\n   procedure Square (X : in out Integer);\nend Demo;\n```\ngenerates\n``` xml\n<CompilationUnit>\n  <AdaNodeList/>\n  <LibraryItem>\n    <PrivateAbsent/>\n    <PackageDecl>\n      <DefiningName>\n        <Id>Demo</Id>\n      </DefiningName>\n      <PublicPart>\n        <AdaNodeList>\n          <SubpDecl>\n            <OverridingUnspecified/>\n            <SubpSpec>\n              <SubpKindProcedure>procedure</SubpKindProcedure>\n              <DefiningName>\n                <Id>Square</Id>\n              </DefiningName>\n              <Params>\n                <ParamSpecList>\n                  <ParamSpec>\n                    <DefiningNameList>\n                      <DefiningName>\n                        <Id>X</Id>\n                      </DefiningName>\n                    </DefiningNameList>\n                    <AliasedAbsent/>\n                    <ModeInOut>in out</ModeInOut>\n                    <SubtypeIndication>\n                      <NotNullAbsent/>\n                      <Id>Integer</Id>\n                    </SubtypeIndication>\n                  </ParamSpec>\n                </ParamSpecList>\n              </Params>\n            </SubpSpec>\n          </SubpDecl>\n        </AdaNodeList>\n      </PublicPart>\n      <EndName>\n        <Id>Demo</Id>\n      </EndName>\n    </PackageDecl>\n  </LibraryItem>\n  <PragmaNodeList/>\n</CompilationUnit>\n```\n",
  "maintainers": [
    "Simon Wright <simon@pushface.org>"
  ],
  "maintainers-logins": [
    "simonjwright"
  ],
  "name": "libadalang2xml",
  "origin": {
    "commit": "6f93873ff4bd379d5c6ae9d8dcdb36d7271c3f25",
    "url": "git+https://github.com/simonjwright/libadalang2xml.git"
  },
  "tags": [
    "ada",
    "xml"
  ],
  "version": "1.0.0",
  "website": "https://github.com/simonjwright/libadalang2xml"
}
