Skip to main content

Interpreter for the Rule Specification Language (RSL)

Project description

pyrsl is an interpreter for a language called RSL (Rule Specification Language). RSL is commonly used as a template language to express transformations from a BridgePoint model into a textual representation, e.g. when writing model compilers or when generating html documentation from a model.

Installation

POSIX

POSIX users with python available on thier system may grap gen_erate.pyz from a release. The .pyz file contain pyrsl and all of its dependencises, and may be executed directly without installing anything:

$ chmod +x gen_erate.pyz
$ ./gen_erate.pyz

Optionally, the .pyz file may be added to your PYTHONPATH:

$ export PYTHONPATH=some/path/gen_erate.pyz
$ python -m rsl.gen_erate -h

pyrsl is also available from pypi:

$ python -m pip install pyrsl
$ python -m rsl.gen_erate -h

Windows

Generally, Windows users don’t have python installed. However, pyrsl releases include gen_erate.exe that contain pyrsl and all of its dependencies, including python.

Command Line Options

To remain backwards compatable with the original RSL interpreter, some command line options are a bit confusing. Also, some of the options are not used by pyrsl.

pyrsl also contain a few additional command line options not available in the original RSL interpreter:

-include

Add a path to list of dirs to search for include files.

-diff

Save a diff of all emits to a filename.

-emit

Chose when to emit, i.e. never, on change, or always.

-force

Make read-only emit files writable.

For more information, see the help text by appending -h to the command line when executing pyrsl.

Language Reference

See BridgePoint UML Suite Rule Specification Language.

Developer Notes

Dependencies

pyrsl depend on pyxtuml, see its github page for install instructions.

Test suites

pyrsl contain a set of unit tests that may be executed:

$ git clone https://github.com/john-tornblom/pyrsl.git
$ cd pyrsl
$ python setup.py test

Customizing gen_erate

pyrsl may be extended to include additional builtin functions, i.e. bridges, and additional string formatters. The extensions may be added to your own pyz file by invoking package_pyz.sh located in the pyrsl source root folder:

$ ./package_pyz.sh examples/customization.py
$ ./gen_erate.pyz -nopersist -arch examples/customization_test.arc
Running my custom version of gen_erate
customization_test.arc: 4:  INFO:  the md5 of 'hello world' is 619d201e5209d3d52342cc5b6616b0cf
customization_test.arc: 11:  INFO:  the md5 of hello world is 5eb63bbbe01eeed093cb22bb8f5acdc3

See customization.py and customization_test.arc for more information.

Reporting bugs

If you encounter problems with pyrsl, please file a github issue. If you plan on sending pull request which affect more than a few lines of code, please file an issue before you start to work on you changes. This will allow us to discuss the solution properly before you commit time and effort.

License

pyrsl is licensed under the GPLv3, see LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrsl-0.4.3.tar.gz (31.9 kB view details)

Uploaded Source

File details

Details for the file pyrsl-0.4.3.tar.gz.

File metadata

  • Download URL: pyrsl-0.4.3.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyrsl-0.4.3.tar.gz
Algorithm Hash digest
SHA256 b43cc6846caed43b2288f268c86e062c99b64c572be8f0a80627127158a60f32
MD5 4d76065026f77d6d38a76bc30828c22f
BLAKE2b-256 0d13944aa02cef04acc3301ec9d9b43a8a4a377dbd6951d5df133184a4165ff0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page