26.09.2013 Views

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 8. SPECIFICATIONS<br />

RSL specification:<br />

ValueExpr ==<br />

Make_ValueOrVariableName(<br />

value_or_variable_name : ValueOrVariableName) |<br />

ProductExpr(value_expr_list : ValueExpr ∗ ) |<br />

ValueInfixExpr(<br />

left : ValueExpr,<br />

op : InfixOperator,<br />

right : ValueExpr),<br />

ValueOrVariableName :: id : Id,<br />

InfixOperator ==<br />

PLUS |<br />

MINUS |<br />

EQUAL,<br />

Id :: getText : Text<br />

As can be seen in Example 8.1 the parenthesizes and commas <strong>of</strong> the<br />

product expression are removed in the RSL AST specification.<br />

8.3 Specification <strong>of</strong> the Transformer<br />

The specification <strong>of</strong> the transformer Transformer.rsl described in this section<br />

is written in RSL. It specifies how an applicative version <strong>of</strong> an RSL AST can<br />

be transformed <strong>into</strong> the corresponding imperative version <strong>of</strong> the RSL AST.<br />

The full specification <strong>of</strong> the transformer in RSL can be found in Appendix C.<br />

In the following a description <strong>of</strong> four maps central to the transformer<br />

specification will be given and then the structure <strong>of</strong> the specification will be<br />

described.<br />

8.3.1 The Maps<br />

In order to do the transformation some extra types are necessary. These<br />

extra types are described in the following.<br />

The TRANS Map<br />

The map TRANS is defined as follows:<br />

TRANS = Id →m Id<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!