Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...

26.09.2013 Views

CHAPTER 9. IMPLEMENTATION OF THE TRANSFORMER All this could have been avoided either by implementing the transformer directly in Java or by extending and improving the RSL2Java tool. 9.8 Implemented Functionality An overview of the functionality of the transformer is given below. 9.8.1 Check for Syntactical Constraints The transformer does not check the syntax of the applicative RSL specification. This means that the applicative specification should be syntax checked using the RSL syntax checker before applying the transformer to the specification. Furthermore, the lexer and parser do only parse constructs not mentioned in the list of syntactical constraints in Chapter 4. If the user tries to transform a specification containing e.g. extending class expressions the user will be notified through error messages. 9.8.2 Check for Non-Syntactically Constraints The presence of constraints mentioned in the list of non-syntactical constraints in Chapter 4 are checked during the check for transformability. The occurrence of such a construct in a specification given to the transformer will result in an error message. It is not checked whether overloading is used in the specification. This means that it is possible to transform specifications containing overloading but the result is probably not correct, which means that overloading should be avoided. 9.8.3 Check for Transformability Before the actual transformation of a given applicative specification it is checked whether the specification is transformable according to the rules given in Chapter 5. If the specification is not transformable it is reported to the user and the specification is not transformed. 9.8.4 Transformable RSL Expressions The following is a list of the RSL expressions that can be transformed if they do not violate any of the constraints given in the lists in Chapter 4 and if they are transformable in the sense explained in Chapter 5. 106

General Expressions • Non-parameterized scheme definitions. • Basic class expressions. • Sort definitions not of the type of interest. • Variant definitions. • Short record definitions. • Abbreviation definitions. • Explicit value definitions. • Explicit function definitions. Type Expressions • Type literals. • Type names. • Product type expressions. • Set type expressions (finite, infinite). • List type expressions (finite, infinite). • Finite map type expressions. • Subtype expressions. • Bracketed type expressions. 9.8. IMPLEMENTED FUNCTIONALITY The transformation of infinite map type expressions is implemented, but infinite map type expressions cannot be parsed due to the structure of the parser of the RSL2Java tool. It would require major changes to the grammar file if the parser should be able to parse infinite map type expressions. Value Expressions • Value literals. • Value names. • Basic expression (chaos). • Product expression. 107

CHAPTER 9. IMPLEMENTATION OF THE TRANSFORMER<br />

All this could have been avoided either by implementing the transformer<br />

directly in Java or by extending and improving the RSL2Java tool.<br />

9.8 Implemented Functionality<br />

An overview <strong>of</strong> the functionality <strong>of</strong> the transformer is given below.<br />

9.8.1 Check for Syntactical Constraints<br />

The transformer does not check the syntax <strong>of</strong> the applicative RSL specification.<br />

This means that the applicative specification should be syntax checked<br />

using the RSL syntax checker before applying the transformer to the specification.<br />

Furthermore, the lexer and parser do only parse constructs not mentioned<br />

in the list <strong>of</strong> syntactical constraints in Chapter 4. If the user tries to<br />

transform a specification containing e.g. extending class expressions the user<br />

will be notified through error messages.<br />

9.8.2 Check for Non-Syntactically Constraints<br />

The presence <strong>of</strong> constraints mentioned in the list <strong>of</strong> non-syntactical constraints<br />

in Chapter 4 are checked during the check for transformability. The<br />

occurrence <strong>of</strong> such a construct in a specification given to the transformer will<br />

result in an error message.<br />

It is not checked whether overloading is used in the specification. This<br />

means that it is possible to transform specifications containing overloading<br />

but the result is probably not correct, which means that overloading should<br />

be avoided.<br />

9.8.3 Check for Transformability<br />

Before the actual transformation <strong>of</strong> a given applicative specification it is<br />

checked whether the specification is transformable according to the rules<br />

given in Chapter 5. If the specification is not transformable it is reported to<br />

the user and the specification is not transformed.<br />

9.8.4 Transformable RSL Expressions<br />

The following is a list <strong>of</strong> the RSL expressions that can be transformed if they<br />

do not violate any <strong>of</strong> the constraints given in the lists in Chapter 4 and if<br />

they are transformable in the sense explained in Chapter 5.<br />

106

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

Saved successfully!

Ooh no, something went wrong!