Skip to content

Parsing sequenced statement sets

Leon Starr edited this page Sep 11, 2023 · 8 revisions

The parsed Scrall will give us a block or statement that may be preceded by any number of sequence_tokens.

When one or more of these tokens are present we will need to populate the corresponding Sequence Flows.

To do this, we will need to determine the source and destination actions of each Sequence Flow.

The source will found in a statement_set that is followed by an input sequence_token with the same name as the output sequence_token and the destination will be in each sequenced_statement_set that is preceded by that name.

Sequence flow input

Let’s start with the input and say that we have some sequence token named 1 indicating that a statement_set has completed execution. (Creative names aren’t usually necessary when it comes to sequencing within an Activity).

In terms of the metamodel, what this really means is that each terminal action of each statement in the statement_set is the source of a Sequence Flow. If there is more than one Sequence Flow we flow them all through a Gate which outputs a single Sequence Flow to indicate that all of the Gate inputs have been enabled.

Here is a Scrall scalar_assignment statement that invokes a method on the local instance followed by an output sequence_token:

This statement will be populated as two Actions with their specified Flows and specification inputs. The terminal action will output a Sequence Flow labeled by the name in the output sequence_token.

A terminal Action is any Action populated from a statement that does not output any Data Flow.

Now consider a block of statements that must complete before another block may proceed.

Two methods must be invoked on the local instance (in no particular order) before another two local methods, also not ordered, are allowed to execute.

Each terminal Action in the first block emits an unlabled Sequence Flow. These each feed into a Gate whose sole purpose is to emit the labeled Sequence Flow when each of the input Sequence Flows has been enabled. Note that a Flow has one source and one or more targets. So the output Sequence Flow is a single Flow even though it is fed to multiple Actions.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally