next up previous
Next: 1.3.3 Reusability enhancement Up: 1.3 Action semantics and Previous: 1.3.1 The scheme of

1.3.2 Examples of SDF description

To give as concrete examples on the look and feel of SDF description, the following pieces of description are excerpted from [Mos02].

An example of action notation in SDF:

Action ActionInfix Action $\to$ Action {left}
"moreover" $\to$ ActionInfix
{left} denotes the left associative precedence.

According to this action notation, A1 moreover A2 is a valid action composed from subactions A1 and A2. A1 moreover A2 = (A1 and A2) then give overriding_ is a valid statement in the language description, where give overriding_ is a kernel data operation and is predefined.

An example of data notation in SDF:

Data DataOpInfix Data $\to$ Data {left}
"+"|"-"|"*" $\to$ DataOpInfix

According to this data notation, we expect a1 + a2 - a3 to be a data expression in the language specification (if we define a1, a2 and a3 to be data previously).

An example of condition notation in SDF:

conditional(Cond, Stmt, Stmt) $\to$ Stmt {cons}
{cons} specifies it is a condition statement.

An example of semantics notation:

execute Stmt $\to$ Action

The semantics definition of this syntactically defined execute statement would be found in another separate module. It may look like:

execute sequence(S1, S2) = execute S1 and then execute S2

There can be multiple such semantics definitions in the module, each defining a single semantics pattern. The combination of these definitions gives the full semantics of the execute statement in the SDF description.

The last mentioned module is not part of the SDF description, because it defines semantics rather than syntax. execute, sequence and and then are primitive notations and combinators in action semantics.


next up previous
Next: 1.3.3 Reusability enhancement Up: 1.3 Action semantics and Previous: 1.3.1 The scheme of
Thomas Feng 2003-04-18