{"id":19934592,"url":"https://github.com/isaacmaffeis/asmetal2java","last_synced_at":"2025-03-01T12:16:28.606Z","repository":{"id":252970619,"uuid":"840854269","full_name":"isaacmaffeis/asmetal2java","owner":"isaacmaffeis","description":"Asmetal2java is a tool that automatically generates a Java file from an Abstract State Machine (ASM) specification written in Asmeta.","archived":false,"fork":false,"pushed_at":"2024-10-29T21:52:51.000Z","size":2255,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T02:07:44.196Z","etag":null,"topics":["asmeta","java","xtend"],"latest_commit_sha":null,"homepage":"https://asmeta.github.io/index.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaacmaffeis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T22:27:22.000Z","updated_at":"2024-10-29T21:52:54.000Z","dependencies_parsed_at":"2024-08-29T18:31:16.838Z","dependency_job_id":"4dac6f42-3d48-4837-89b4-13a0fd20c66a","html_url":"https://github.com/isaacmaffeis/asmetal2java","commit_stats":null,"previous_names":["isaacmaffeis/asmetal2java"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacmaffeis%2Fasmetal2java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacmaffeis%2Fasmetal2java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacmaffeis%2Fasmetal2java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacmaffeis%2Fasmetal2java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaacmaffeis","download_url":"https://codeload.github.com/isaacmaffeis/asmetal2java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241361445,"owners_count":19950381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asmeta","java","xtend"],"created_at":"2024-11-12T23:17:21.375Z","updated_at":"2025-03-01T12:16:28.580Z","avatar_url":"https://github.com/isaacmaffeis.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asmetal2java\n[![Static Badge](https://img.shields.io/badge/asmeta-main_repository-black?style=social\u0026logo=github\u0026link=https%3A%2F%2Fgithub.com%2Fasmeta%2Fasmeta)](https://github.com/asmeta/asmeta)\n[![Build and Push CI Pipeline](https://github.com/isaacmaffeis/asmetal2java/actions/workflows/maven-docker-pipeline.yml/badge.svg)](https://github.com/isaacmaffeis/asmetal2java/actions/workflows/maven-docker-pipeline.yml)\n\nAsmetal2java is a tool that automatically generates a Java file from an Abstract State Machine (ASM)\nspecification written in Asmeta. This allows developers and researchers to quickly convert ASM \nmodels into Java code, facilitating the integration of formal specifications into software \ndevelopment processes.\n\n## Origins and Contributions\nThis project was originally developed as part of the Asmeta repository.\nThe majority of the work, including the core functionalities and foundational code,\nwas done by the Asmeta team.\nYou can find the original project and more information about their work in the:\n[asmetal2java](https://github.com/asmeta/asmeta/tree/master/code/experimental/asmetal2java).\n\n\n## Asmeta Framework\nAsmetal2java is part of the larger Asmeta (ASMETA: Abstract State Machines Environment for \nModeling and Analysis) framework, which is an environment for the formal modeling and analysis of\nsystems using Abstract State Machines (ASMs).\n\nThe [Asmeta](https://github.com/asmeta/asmeta/tree/master) framework provides a comprehensive suite\nof tools for creating, simulating, verifying, and analyzing ASM models.\n\n## Project Overview\n\nThis repository contains two executable projects:\n\n- [asmetal2java_codegen](#Asmetal2java_codegen) (Main Project)\n- [asmetal2java_asmgen](#Asmetal2java_asmgen) (Extension Project)\n\n# Asmetal2java_codegen\n\nThe main project, **asmetal2java_codegen**, is responsible for translating an Abstract State Machine (ASM) into Java code. \nIt generates an executable class named \u003casmFileName\u003e_Exe that allows users to interact with the ASM step by step. \nThis feature provides a hands-on approach to work with ASMs, enabling users to manually follow the execution of the state machine at each step.\n\n## How to Start:\n\n### Using Maven\n1. Open PowerShell or your preferred terminal and clone the repository:\n    ```shell\n    git clone https://github.com/isaacmaffeis/asmetal2java.git\n    ```\n\n2. Navigate into the project directory:\n    ```shell\n    cd ./asmetal2java\n    ```\n\n3. Install the project and generate the executable JAR:\n    ```shell\n    mvn clean install\n    ```\n\n4. Start the application by running the generated JAR file:\n    ```shell\n    java -jar ./asmetal2java_codegen/target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar\n     ```\n\n5. Customize execution with additional options:\n    ```shell\n    java -jar ./asmetal2java_codegen/target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input \u003cinput\u003e -output \u003coutput\u003e -D\u003cproperty=value\u003e\n    ```\n    - `-input` : The ASM input file (required)\n\n    - `-output` : The output folder (optional, defaults to `./output/`)\n\n    - `-D \u003cproperty=value\u003e` : Additional translator options\n      \n     | Option             | Argument Type     | Description |\n     |--------------------|-------------------|-------------|\n     | `-input`           | String (required) | Path to the ASM input file. |\n     | `-output`          | String (optional) | Specifies the output folder. Defaults to `./output/`. |  \n     | `-Dformatter`      |  boolean (optional)       | whether the generated code should be formatted. |\n     | `-DshuffleRandom` | boolean (optional) |  whether a random shuffle should be applied. |\n     | `-DoptimizeSeqMacroRule` | boolean (optional) | whether to optimize the sequence macro rule. |\n\n\n7. Example of a use case:\n    ```shell\n    java -jar ./asmetal2java_asmgen/target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input \"examples/RegistroDiCassa.asm\" -output \"../asmetal2java_examples/src/\" -Dformatter=true\n     ```\n\n### Using Docker\n\n1. Open Docker Desktop and pull the Docker image:\n    ```shell\n    docker pull isaacmaffeis/asmetal2java_codegen:latest\n    ```\n\n2. Run the application (print the help message) within a Docker container:\n    ```shell\n    docker run --rm isaacmaffeis/asmetal2java_codegen\n    ```\n\n3. Mount the volumes and run:\n    ```shell\n    docker run --rm -v \"$(pwd)/\u003cinput\u003e:/app/input\" -v \"$(pwd)/\u003coutput\u003e:/app/output\" isaacmaffeis/asmetal2java_codegen -input \u003cinput\u003e -output \u003coutput\u003e -D\u003cproperty=value\u003e\n    ```\n\n    - `-v \"$(pwd)/\u003cinput\u003e:/app/input\"` : Maps the input file from the host to the container (required)\n\n    - `-v \"$(pwd)/\u003coutput\u003e:/app/output\"` : Maps the output folder from the host to the container (required)\n\n4. Example of a use case:\n   Inside the root directory `./amsetal2java/` run:\n    ```shell\n    docker run --rm -v \"$(pwd)/asmetal2java_codegen/examples:/app/input\" -v \"$(pwd)/asmetal2java_codegen/output:/app/output\" isaacmaffeis/asmetal2java_codegen -input \"input/RegistroDiCassa.asm\" -output \"output\"\n    ```\n# Asmetal2java_asmgen\n\nThe extension project, **asmetal2java_asmgen**, extends asmetal2java_codegen by generating a class named \u003casmFileName\u003e_ASM. \nUnlike the executable class generated by asmetal2java_codegen, which requires user interaction to step through the Abstract State Machine (ASM) execution, \nthe _ASM class produced by asmetal2java_asmgen is designed for automated processes without the need for manual interactions.\n\n## How to Start:\n\n### Using Maven\n1. Open PowerShell or your preferred terminal and clone the repository:\n    ```shell\n    git clone https://github.com/isaacmaffeis/asmetal2java.git\n    ```\n\n2. Navigate into the project directory:\n    ```shell\n    cd ./asmetal2java\n    ```\n    \n3. Install the project and generate the executable JAR:\n    ```shell\n    mvn clean install\n    ```\n\n4. Start the application by running the generated JAR file:\n    ```shell\n    java -jar ./asmetal2java_asmgen/target/asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar\n     ```\n\n5. Customize execution with additional options:\n    ```shell\n    java -jar ./asmetal2java_asmgen/target/asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input \u003cinput\u003e -output \u003coutput\u003e -D\u003cproperty=value\u003e\n    ```\n    - `-input` : The ASM input file (required)\n\n    - `-output` : The output folder (optional, defaults to `./output/`)\n\n    - `-D \u003cproperty=value\u003e` : Additional translator options\n      \n     | Option             | Argument Type     | Description |\n     |--------------------|-------------------|-------------|\n     | `-input`           | String (required) | Path to the ASM input file. |\n     | `-output`          | String (optional) | Specifies the output folder. Defaults to `./output/`. |  \n     | `-Dformatter`      |  boolean (optional)       | whether the generated code should be formatted. |\n     | `-DshuffleRandom` | boolean (optional) |  whether a random shuffle should be applied. |\n     | `-DoptimizeSeqMacroRule` | boolean (optional) | whether to optimize the sequence macro rule. |\n     | `-finalState` | String (optional) | Final state condition of the ASM |\n\n7. Example of a use case:\n    ```shell\n    java -jar ./asmetal2java_asmgen/target/asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input \"examples/RegistroDiCassav4.asm\" -output \"../asmetal2java_examples/src/\" -Dformatter=true -finalState state\u003e=5:statoCassa==Stati.CHIUSO\n     ```\n\n### Using Docker\n\n1. Open Docker Desktop and pull the Docker image:\n    ```shell\n    docker pull isaacmaffeis/asmetal2java_asmgen:latest\n    ```\n\n2. Run the application (print the help message) within a Docker container:\n    ```shell\n    docker run --rm isaacmaffeis/asmetal2java_asmgen\n    ```\n\n3. Mount the volumes and run:\n    ```shell\n    docker run --rm -v \"$(pwd)/\u003cinput\u003e:/app/input\" -v \"$(pwd)/\u003coutput\u003e:/app/output\" isaacmaffeis/asmetal2java_asmgen -input \u003cinput\u003e -output \u003coutput\u003e -D\u003cproperty=value\u003e\n    ```\n\n    - `-v \"$(pwd)/\u003cinput\u003e:/app/input\"` : Maps the input file from the host to the container (required)\n\n    - `-v \"$(pwd)/\u003coutput\u003e:/app/output\"` : Maps the output folder from the host to the container (required)\n\n4. Example of a use case:\n   Inside the root directory `./amsetal2java/` run:\n    ```shell\n    docker run --rm -v \"$(pwd)/asmetal2java_asmgen/examples:/app/input\" -v \"$(pwd)/asmetal2java_asmgen/output:/app/output\" isaacmaffeis/asmetal2java_asmgen -input \"input/RegistroDiCassav4.asm\" -output \"output\"\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaacmaffeis%2Fasmetal2java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaacmaffeis%2Fasmetal2java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaacmaffeis%2Fasmetal2java/lists"}