Figure 2.20. Concrete Syntax for Thread and Function Declarations
|
Figure 2.20, “Concrete Syntax for Thread and Function Declarations” presents the concrete syntax for thread and function declarations. Threads and functions are similar, except that functions can return values. If the "active" modifier is used, then the thread is alive in the initial state of the system; one can optionally put the multiplicities for an active thread to specify the number of instances of that thread in the initial state.
There are two kinds of thread and function bodies in BIR: (1) low-level body, and (2) high-level body. Low-level body is unstructured (similar to Java bytecode), while high-level body is structured (similar to Java sourcecode). Bogor actually works on the low-level body; it first translates high-level bodies to their low-level equivalents.
Namespace. The namespace for threads and functions is the global namespace that is shared with constants, enumerations, records, extensions, type-aliases, virtual tables, and functional expressions.
Abstract Syntax Tree.
The Java AST class for both thread and function declarations is the FSM class.
Namespace. Each thread and function has its own namespace for parameters and local variables (i.e., parameters and local variables share the same namespace), but hiding the name in the global namespace is disallowed.
Abstract Syntax Tree. The Java AST class for parameters is the TypedId class. The Java AST class for local is the Local class.