Eclipse is probably best known as a Java IDE, but it is more: it is an IDE framework, a tools framework, an open source project, a community, an eco-system, and a foundation.

MoDisco Tool - Java Abstract Syntax Discovery Tool

MoDisco Logo


Java, Abstract Syntax Tree (AST), Compilation unit, Eclipse JDT


This generic tool is about discovering a full abstract syntax tree (AST) of the code (statements, expressions, annotations and Javadoc) taken from a Java compilation unit (typically a Class). It builds models, representing Java compilation units, which conform to a metamodel designed from the Eclipse JDT Java API.

This tool is provided by INRIA AtlanMod and its development is being supported by the IST European MODELPLEX project (MODELing solution for comPLEX software systems, FP6-IP 34081).

The overall approach is summarized in the following figure:

"Java Abstract Syntax" Tool Overview

The discoverer, named JavaAbstractSyntaxDiscoverer, is built upon the Eclipse JDT. It takes as input a Java compilation unit (DOT java file). It uses the JDT parser in order to have an in-memory representation of the compilation unit. Then, it uses a visitor processing each in-memory AST node and creates the corresponding model elements.

We defined a metamodel of the Java compilation unit's syntax by studying the Eclipse JDT API. This metamodel, named JavaAbstractSyntax metamodel, is available at the Download section.

We provide below a short excerpt, representing the simple System.out.println("Done!"); Java statement, of a model (in XMI format) created by using this discoverer:

Excerpt (representing the System.out.println("Done!"); Java statement) of a model produced by the discoverer

Related Use Cases

Choose a use case

SharenGo Java Legacy

This complete use case, which covers both the "Model Discovery" and "Model Understanding" phases, is about reverse engineering a Java application. It uses the Java Abstract Syntax discovery tool (from the MoDisco Tool Box) to discoverer the abstract syntax tree (AST) of each Java compilation unit (i.e. each source file). The generated models are then analyzed by model transformations in order to produce a SharenGo business model.


Choose a document

Java Abstract Syntax Discovery Tool Installation & User Guide: How to install and use the discoverer for building Java AST models from Java compilation units.
Not yet available.


Choose a download

First complete version of the Java Abstract Syntax Discovery Tool plug-in (with all the required resources including a use example and the metamodel). All the sources contained in the archive are also available from the MoDisco SVN

General Information
Related Links