5 Parsers

The PKM leverages on external parsing tools to:

5.1 Source codes

5.1.1 C

Frama-C is the parser for the C language. Frama-C also provides EVA (Abstract Interpretation symbolic execution) and WP (program proof using Hoare Logic) analysis plugins. The C source code annotations for the C language shall be written in ACSL (Abstract C specification language). Frama-C for PKM has a command line interface and a REST API over HTTP/HTTPS.

The implementation is organized as the following:

Appendix A.2 contains detailed explanations about implementation design of the REST server that provides developer with the REST API.

5.1.2 C++

Frama-Clang is the parser for the C++ language. Frama-Clang leverages on Clang 13 which supports C++ 98, C++03, C++11, C++14, C++17 almost totally, and C++20 partially (see clang C++ status for more details). The C++ source code annotations for the C++ language shall be written in ACSL++ (Abstract C++ specification language, an extension of ACSL for C++). Frama-Clang for PKM has a command line interface and a REST API over HTTP/HTTPS.

The implementation is organized as the following:

Appendix A.2 contains detailed explanations about implementation design of the REST server that provides developer with the REST API.

5.1.3 Java

Java parser provides parsing of the Java language. The Java source code annotations for the Java language shall be written in JML. Java parser has a REST API over HTTP/HTTPS. The implementation of java parser is available at https://gitlab.ow2.org/decoder/javaparsertool/-/tree/master/javaparser.

5.2 Documentation

ASFM tools provides everything related to ASFM (Abstract Semi-Formal Model) documentation.

The implementation is organized as the following:

Appendix A.2 contains detailed explanations about implementation design of the REST server that provides developer with the REST API.

5.2.1 Microsoft Office .docx

doc_to_asfm converts a Microsoft Office .docx file to an ASFM (Abstract Semi-Formal Model) document. Note that asfm_to_doc converts an ASFM (Abstract Semi-Formal Model) documents back to a Microsoft Office .docx file.

The implementation is organized as the following:

5.2.2 Code to ASFM

code_to_asfm converts source code ASTs to an ASFM (Abstract Semi-Formal Model) document. It currently only supports C++.

5.3 UML

5.3.1 Classes

ClassModelXMI2JSON extracts UML2 classes from an XMI file and convert them to a JSON document. The implementation is available at https://gitlab.ow2.org/decoder/javaparsertool/-/tree/master/classmodelxmi2jsontransformer.

5.3.2 State Machines

SMModelXMI2JSON extracts UML2 state machines from an XMI file and convert them to a JSON document. The implementation is available at https://gitlab.ow2.org/decoder/javaparsertool/-/tree/master/smmodelxmi2jsontransformer.

5.4 Executable binaries

5.4.1 DWARF debugging information

Excavator is a reverse engineering tool which parses DWARF debugging information in ELF executable binaries, processes compilation units and generates an equivalent (interfaces and code skeletons only) compilable C source code.

The implementation is organized as the following:

Appendix A.2 contains detailed explanations about implementation design of the REST server that provides developer with the REST API.