Skip to content

Enumerated values

Leon Starr edited this page Nov 6, 2023 · 2 revisions

Since enumerated values are generally limited in number and are often used to test cases, it makes sense to express them in actions. So these literals are allowed in Scrall.

A type might be defined such as Valve State with values { open, closed }

And then a variable position of that type would be used like so to decide which event to send:

position?
   _open : Close -> target valve
   _closed : Open -> target valve

Enumerated values are always prefaced with a _ symbol in Scrall. In circumstances where the data type cannot be inferred from context, the data type must precede the value like this: Valve State::_closed.

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