Skip to content

bigraph-toolkit-suite/bigraphs.bdsl-interpreter-parent

Repository files navigation

License: Apache 2.0 Maven Central

logo of bdsl interpreter


BDSL Interpreter Framework

The BDSL Interpreter Framework provides an extensible foundation for bigraphical language engineering with the Bigraphical Domain-specific Language (BDSL).
It is organized as a multi-module Maven project and is designed to let you integrate BDSL parsing and execution into your own applications.

Version Compatibility

The framework depends on specific versions of the BDSL grammar and the Bigraph Framework.

BDSL Interpreter Release BDSL Grammar Bigraph Framework
2.2.2 (current) 2.1.0 2.2.1
2.2.1 2.0.1 2.2.0
2.2.0 2.0.1 2.2.0
2.0.1 2.0.1 2.0.1

Standalone Tool

The most convenient way to experiment with BDSL is via the standalone command-line interface (CLI).

After building the tool (see Building the Interpreter), you can run BDSL scripts directly from the command line.

Usage

java -jar bdsl.jar --version
java -jar bdsl.jar --main=./program.bdsl <other-options...>
java -jar bdsl.jar --help

This prints the interpreter version, executes a BDSL script, or shows available command-line options.

Screenshot

Screenshot of the BDSL interpreter tool

Running Examples

A simple example script is provided under the test resources.

$ java -jar ./out/bdsl.jar --main=./bdsl-interpreter-cli/src/test/resources/test_bdsl_01.bdsl

The file test_bdsl_01.bdsl located in bdsl-interpreter-cli/src/test/resources/ demonstrates basic BDSL language and serves as a quick sanity check for your build.

Screenshot

screenshot-of-bdsl-interpreter

Building the BDSL Interpreter Tool

To build a standalone command-line tool of the interpreter (called the CLI here):

# Linux, Mac
$ mvn clean package -DskipTests -Pbuild-cli
# or
$ ./mvnw clean package -DskipTests -Pbuild-cli

# Windows
$ ./mvnw.cmd clean package -DskipTests -Pbuild-cli

The resulting bdsl.jar will be available under the ./out/ directory.

Framework Usage in Maven/Gradle Projects

To integrate the interpreter into your own Maven/Gradle project, declare the required dependencies described below.

By embedding the framework directly, you can fully control BDSL parsing and interpretation, allowing to customize execution logic, extend language behavior, and integrate the interpreter into other application code.

Dependencies

Maven

<dependencies>
    <!-- Core: low-level building blocks of the interpreter for JAVA API usage-->
    <dependency>
        <groupId>org.bigraphs.dsl.interpreter</groupId>
        <artifactId>bdsl-interpreter-core</artifactId>
        <version>2.2.2</version>
    </dependency>

    <!-- CLI: command-line interface interpreter for standalone usage and interfacing -->
    <dependency>
        <groupId>org.bigraphs.dsl.interpreter</groupId>
        <artifactId>bdsl-interpreter-cli</artifactId>
        <version>2.2.2</version>
    </dependency>

    <!-- Exec: advanced BDSL statement execution strategy-->
    <dependency>
        <groupId>org.bigraphs.dsl.interpreter</groupId>
        <artifactId>bdsl-execution-common</artifactId>
        <version>2.2.2</version>
    </dependency>
</dependencies>

Gradle

dependencies {
    // Core: low-level building blocks of the interpreter for Java API usage
    implementation "org.bigraphs.dsl.interpreter:bdsl-interpreter-core:2.2.2"

    // CLI: command-line interface interpreter for standalone usage and interfacing
    implementation "org.bigraphs.dsl.interpreter:bdsl-interpreter-cli:2.2.2"

    // Exec: advanced BDSL statement execution strategy
    implementation "org.bigraphs.dsl.interpreter:bdsl-execution-common:2.2.2"
}

API Usage

Practical usage examples can be found in the provided unit tests, which demonstrate typical parsing and interpretation workflows using the framework APIs:

Project Modules

The framework is split into several reusable modules:

  • bdsl-interpreter-parent Parent module that manages shared configuration, dependencies, and build settings for all submodules.

  • bdsl-interpreter-cli Command-line tool that exposes the interpreter’s functionality for scripting and quick experimentation.

  • bdsl-interpreter-core Core components of the BDSL interpreter.
    Defines the parsing framework using the visitor design pattern and extension methods.
    Depends on the BDSL Grammar and evaluates individual language statements.

  • bdsl-execution-common Provides a common execution environment and reusable strategies for the interpreter, including shared execution logic and environment management.

Development

For full build options and deployment instructions, see DEVELOPMENT.md.

Support and Contributions

For questions, bug reports, or contributions, please use the issue tracker of the project repository:

https://github.com/bigraph-toolkit-suite/bigraphs.bdsl-interpreter-parent/issues

License

Copyright 2020 Bigraph Toolkit Developers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

An interpreter for BDSL | Standalone Tool and API | Grammar: https://github.com/bigraph-toolkit-suite/bigraphs.bdsl-grammar

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors