How objectionary/dejump works
Project Type and Purpose
• This is a standalone CLI application written in Java.
• Its purpose is to read an EO program (in .eo or .xmir format), apply a series of transformations that eliminate goto objects, and write a semantically equivalent EO/XMIR output.
• It is built and packaged with Maven, uses XSLT stylesheets for the core transformations, and includes a test pipeline that leverages gmavenplus-plugin and eo-maven-plugin to turn sample .eo files into JUnit tests.
Core File-Structure Analysis
• src/main/java/org/eolang/dejump
• Main.java – the CLI entry‐point that parses arguments, locates input, and invokes the transformation engine.
• RemoveGoto.java – orchestrates the pipeline of XSLT transforms.
• src/main/resources/org/eolang/dejump/*.xsl
• The set of XSLT stylesheets, each performing one rewrite step (e.g., “goto-to-while.xsl”, “flags-to-memory.xsl”).
• src/test/eo/org/eolang/dejump
• Sample .eo programs exercising various goto patterns.
• src/test/java/org/eolang/dejump
• JUnit harness that runs the generated EO tests.
• Maven config
• pom.xml defines dependencies, plugin configuration (gmavenplus, eo-maven-plugin).
• CI workflows
• GitHub Actions under .github/workflows for build, lint, pages, etc.
Key Components
a. CLI Frontend
• Java process invoking Main.java.
• Argument parser producing an InputDescriptor (path, mode: EO vs XMIR).
b. Transformation Engine
• RemoveGoto orchestrator that:
1. Loads the input file into an in-memory DOM or XSLT Source.
2. Sequentially applies each XSLT stylesheet.
3. Accumulates the output for the next step.
c. XSLT Resource Loader
• Classpath loader that finds all .xsl files under resources/org/eolang/dejump.
d. Output Writer
• Writes the final transformed document into a generated/ directory next to the input.
e. Build & Test Pipeline (secondary view)
• gmavenplus-plugin: transforms src/test/eo into EO-based JUnit tests under target/eo-after.
• eo-maven-plugin: compiles and runs those EO tests.
• GitHub Actions: triggers mvn clean install -Pqulice, runs tests, publishes gh-pages.
Relationships and Data Flows
• Separate flow: Maven build phases → gmavenplus → eo-maven-plugin → JUnit test results → GitHub Actions.
Architectural Patterns and Design Principles
• Pipe ‑and- filter pattern for XSLT steps (each stylesheet is a filter).
• Single responsibility: Main handles CLI; RemoveGoto handles sequencing; each XSL only one rewrite rule.
• Resource‐driven plugin model: new .xsl files can be dropped in resources to extend functionality.
Technologies and Frameworks
• Java 11+, Maven 3.8+
• gmavenplus-plugin (generate EO tests)
• eo-maven-plugin (run EO tests)
• XSLT 2.0 via built-in javax.xml.transform APIs
• Log4j for logging
• GitHub Actions for CI/CD