Skip to content

Asmetal2java is a tool that automatically generates a Java file from an Abstract State Machine (ASM) specification written in Asmeta.

Notifications You must be signed in to change notification settings

isaacmaffeis/asmetal2java

Repository files navigation

Asmetal2java

Maven CI Docker CI

Asmetal2java is a tool that automatically generates a Java file from an Abstract State Machine (ASM) specification written in Asmeta. This allows developers and researchers to quickly convert ASM models into Java code, facilitating the integration of formal specifications into software development processes.

Origins and Contributions

This project was originally developed as part of the Asmeta repository. The majority of the work, including the core functionalities and foundational code, was done by the Asmeta team. You can find the original project and more information about their work in the: asmetal2java.

Asmeta Framework

Asmetal2java is part of the larger Asmeta (ASMETA: Abstract State Machines Environment for Modeling and Analysis) framework, which is an environment for the formal modeling and analysis of systems using Abstract State Machines (ASMs).

The Asmeta framework provides a comprehensive suite of tools for creating, simulating, verifying, and analyzing ASM models.

How to Start:

Cloning the Repository

  1. Open PowerShell or your preferred terminal and clone the repository:

    git clone https://github.com/isaacmaffeis/asmetal2java.git
  2. Navigate into the project directory:

    cd ./asmetal2java

Using Maven

  1. Package the core projects to compile the necessary components:

    cd ./core
    mvn clean package
  2. Generate and install the executable JAR file with all dependencies included:

    cd ../asmetal2java_codegen
    mvn clean install
  3. Start the application by running the generated JAR file:

    java -jar ./target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  4. Customize execution with additional options:

    java -jar ./target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input <input> -output <output> -D<property=value>
    • -input : The ASM input file (required)

    • -output : The output folder (optional, defaults to ./output/)

    • -D <property=value> : Additional properties (optional, see -help for more info)

  5. Example of a use case:

    java -jar ./target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input "examples/RegistroDiCassa.asm" -output "../asmetal2java_examples/src/" -Dformatter=true

Using Docker

  1. Open Docker Desktop and build the Docker image:

    docker build -t asmetal2java .
  2. Run the application within a Docker container:

    docker run --rm asmetal2java
  3. Customize execution by passing options:

    docker run --rm -v "$(pwd)/<input>:/app/<input>" -v "$(pwd)/asmetal2java_codegen/<output>:/app/asmetal2java_codegen/<output>" asmetal2java -input <input> -output <output> -D<property=value>
    • -v "$(pwd)/<input>:/app/<input>" : Maps the input file from the host to the container (required)

    • -v "$(pwd)/<output>:/app/asmetal2java_codegen/<output>" : Maps the output folder from the host to the container (required, use <output> as output for the default path)

    • -input : The ASM input file (required)

    • -output : Output folder (optional, defaults to ./output/)

    • -D <property=value> : Additional properties (optional, see -help for more info)

  4. Example of a use case:

    docker run --rm -v "$(pwd)/asmetal2java_codegen/examples:/app/asmetal2java_codegen/examples" -v "$(pwd)/asmetal2java_codegen/output:/app/asmetal2java_codegen/output" asmetal2java -input "examples/RegistroDiCassa.asm" -output "output"

About

Asmetal2java is a tool that automatically generates a Java file from an Abstract State Machine (ASM) specification written in Asmeta.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published