LINVAST infrastructure for Language-Invariant Abstract Syntax Trees

  • Ivan Ristovic Faculty of Mathematics, University of Belgrade
Keywords: Abstract syntax trees (AST), Language-invariant AST, Static analysis, ANTLR parser

Abstract

Tools for static program analysis, i.e., analysis without executing the program, rely on various abstract representations of the program. These representations are created through parsing the program's source code, abstracting, and transforming the results of the parser. As a result, such intermediate representations are tightly coupled with specific programming languages and are therefore incompatible across different languages. This tight coupling of tools with particular languages makes it difficult to develop tools for source-code analysis that are language-independent, and makes it difficult to extend existing tools with support for other programming languages.

This paper presents the LINVAST infrastructure — a common language-invariant source-code abstraction based on abstract syntax trees. LINVAST models syntactic constructs of different programming languages in a uniform way, enabling the creation of tools that operate on source code regardless of the programming language in which the program is written. The LINVAST infrastructure, implemented in the C# programming language, is publicly available and has nearly ten thousand downloads. It currently implements common abstractions for the C, Java, Lua, and Go programming languages.

Published
2025-12-30
Section
Software engineering