The modern code intelligence library for Ada and SPARK

Libadalang is a powerful and modern technology supporting full syntactic analysis of Ada (or SPARK) source code and a comprehensive set of semantic queries, and it can work on code that is incomplete or otherwise invalid. 

The Libadalang library is the foundation for many of AdaCore’s own tools and is included with all native-platform GNAT Pro Ada subscriptions. Using Libadalang, customers can develop a wide range of Ada source code analysis tools in either Ada or Python.

Learn more about GNAT Pro »

Typical Libadalang applications include:

  • Static Analysis (property verification)
  • Code Instrumentation
  • Design and Document Generation Tools
  • Metric, Testing or Timing Tools
  • Dependency Tree Analysis Tools
  • Type Dictionary Generators
  • Coding Standards Enforcement Tools
  • Language Translators (e.g., to CORBA IDL)
  • Quality Assessment Tools
  • Source Browsers and Formatters
  • Syntax Directed Editors

Libadalang is an essential building block for Ada code analysis in several AdaCore tools:

GNAT Studio

Libadalang is the engine that powers semantic queries in GNAT Studio via the Ada Language Server. This allows GNAT Studio to answer queries on evolving and possibly incorrect code.


The CodePeer advanced static analysis tool suite for Ada takes advantage of Libadalang’s efficient parsing to drive its fast, local analysis checkers. These checkers allow developers to analyze their software for potential bugs and vulnerabilities quickly and efficiently.


Libadalang’s tree-rewriting API is used to instrument the source code so that the modified programs can compute code coverage status.

GNATpp/GNATmetric and other tools

GNAT Pro includes a number of Ada-aware tools that perform tasks such as pretty printing the code, computing metrics, and checking compliance with coding standards. Libadalang is used to parse the input source file and either run an analysis or generate source code.

For more information, please visit The introduction to Libadalang.