Skip to main content

Starr's Concise Relational Action Language - For Shlaer-Mellor Executable UML

Project description

Scrall Action Language

Scrall = Starr's Concise Relational Action Language

Why you need this

You are building or exploring Executable UML models using the Shlaer-Mellor methodology and you need a text language for specifying actions that:

  • perform computations
  • access and traverse the class model
  • synchronize states
  • communicate internally and with external entities

With these qualities:

  • platorm independent action sequencing
  • platform independent data types
  • ability to manipulate both instances and attributres as well as relations (tables)
  • conforms to Date and Darwen's formulation of relational and type theory

Scroll down for more about these qualities.

Installation

Create or use a python 3.10+ environment. Then

% pip install scrall

At this point you can invoke the parser via the command line or from your python script.

From your python script

You need this import statement at a minimum:

from scrall.parse.parser import ScrallParser

You can then either specify a path or a text variable using the appropriate method:

result = ScrallParser.parse_text(scrall_text=action_text, debug=False)

OR

result = ScrallParser.parse_file(file_input=path_to_file, debug=False)

Check the code in parser.py to verify I haven't changed these parameters on you wihtout updating the readme.

In either case, result will be a list of parsed scrall statements. You may find the header of the visitor.py file helpful in interpreting these results.

From the command line

This is not the intended usage scenario, but may be helpful for testing or exploration. Since scrall may generate some diagnostic info you may want to create a fresh working directory and cd into it first. From there...

% scrall -f somefile.scrall

The .scrall extension is not necessary, but the file must contain scrall text. See this repository's wiki for more about the scrall language. The grammar is defined in the scrall.peg file. (if the link breaks after I do some update to the code, just browse through the code looking for the scrall.peg file, and let me know so I can fix it)

You can also specify a debug option like this:

% scrall -f somefile.scrall -D

This will create a scrall-diagnostics folder in your current working directory and deposite a coupel of PDFs defining the parse of both the scrall grammar: scrall_parse_tree.pdf and your supplied text: scrall_model.pdf.

You should also see a file named scrall.log

Compatibility

This language is consistent with the Shlaer Mellor Metamodel, another repository on this site. In that repository the metamodel is used to define a schema for a database where user models can be stored and accessed.

Older documentation

NOTE: If you have the Scrall version 1.0.0 PDF, consider it superceded by the wiki on this site where the language spec is now maintained and updated.

Platform independent action sequencing

This language is designed to support data flow execution, so that there is no arbitrary sequencing built in. You can transform any chunk of action language (a method, operation, or state activity) into a data flow graph where each action may execute as soon as all of its inputs are satisfied. So the only sequencing is that demanded by the application, independent of any particular target platform.

Relational operations supported

You can manipulate both instances of classes and relations (tables) interchangeably. Data access is decidely NOT Sql-like. Instead C.J. Date's Tutorial D semantics are supported. This means that relational operations are closed under the algebra such that any given operation yields a relation, so you can readily nest expressions to specify powerful data manipulation.

Class instances may be converted to relations and vice versa.

See the wiki on this repository for a full description of the language features.

UPDATE 2023-7-04

For the last couple of years all of the primary scrall development has been managed in the class-model-dsl (metamodel db) repository. I had it there as a matter of convenience while populating action semantics into the Shlaer-Mellor metamodel. But the time has come to refactor what is becoming a bit of a monolith over there and today, I am permanently moving all the latest scrall code back here to its proper home.

When the migration is complete, you will be able to grab the latest Scrall parser from PyPI without having to download the whole Shlaer-Mellor metamodel database populator. This separation is essential since you might want to define your own action language and parser to use with the metamodel, or just play with Scrall on its own.

I will post another update when it's ready here and on PyPI. The parser is currently in decent shape, so it's just a matter of putting a command line interface on it and a bit of packaging.

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

scrall-0.3.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

scrall-0.3.1-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file scrall-0.3.1.tar.gz.

File metadata

  • Download URL: scrall-0.3.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for scrall-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6bc11c34d2cb2cf78e0bc5df7a2e9631bb0ff93d5a418903348e494e4e2a5c11
MD5 c49b4b989763581251b77ff6010bb32f
BLAKE2b-256 6a7585bee36051cc1b16d78f1647b493fea86f380e9053cde6ec275c232452ae

See more details on using hashes here.

File details

Details for the file scrall-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: scrall-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for scrall-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ecbaa7a6e981b283a0fe851210843460375aef9d94fb7dff8da06daaff873df
MD5 828d5da42f63cff485da2e1930bf3557
BLAKE2b-256 ccc73ad6d9cc1f3020a97b60bb4b917df9d5c211b4d7b43e8eeb487666da650c

See more details on using hashes here.

Supported by

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