Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
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
- Page 72 and 73: CHAPTER 6. TRANSFORMATIONS 56
- Page 74 and 75: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 76 and 77: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 78 and 79: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 80 and 81: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 82 and 83: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 84 and 85: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 86 and 87: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 88 and 89: CHAPTER 8. SPECIFICATIONS The rewri
- Page 90 and 91: CHAPTER 8. SPECIFICATIONS RSL speci
- Page 92 and 93: CHAPTER 8. SPECIFICATIONS The FUNC
- Page 94 and 95: CHAPTER 8. SPECIFICATIONS out, that
- Page 96 and 97: CHAPTER 8. SPECIFICATIONS construct
- Page 98 and 99: CHAPTER 8. SPECIFICATIONS 8.4.1 Mor
- Page 100 and 101: CHAPTER 8. SPECIFICATIONS PRECOND_T
- Page 102 and 103: CHAPTER 8. SPECIFICATIONS if length
- Page 104 and 105: CHAPTER 8. SPECIFICATIONS subtypes.
- Page 106 and 107: CHAPTER 8. SPECIFICATIONS 8.5.2 Cha
- Page 108 and 109: CHAPTER 8. SPECIFICATIONS axiom [ m
- Page 110 and 111: CHAPTER 8. SPECIFICATIONS Specifica
- Page 112 and 113: CHAPTER 8. SPECIFICATIONS the lack
- Page 114 and 115: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 116 and 117: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 118 and 119: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 120 and 121: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 124 and 125: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 126 and 127: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 128 and 129: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 130 and 131: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 132 and 133: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 134 and 135: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 136 and 137: CHAPTER 11. TEST 11.1.1 Lexer and P
- Page 138 and 139: CHAPTER 11. TEST An overview of the
- Page 140 and 141: CHAPTER 12. POSSIBLE EXTENSIONS OF
- Page 142 and 143: CHAPTER 12. POSSIBLE EXTENSIONS OF
- Page 144 and 145: CHAPTER 12. POSSIBLE EXTENSIONS OF
- Page 146 and 147: CHAPTER 13. CONCLUSION RSL AST and
- Page 148 and 149: CHAPTER 13. CONCLUSION 132
- Page 150 and 151: BIBLIOGRAPHY [ST02] Donald Sannello
- Page 152 and 153: APPENDIX A. USING AND EXTENDING THE
- Page 154 and 155: APPENDIX A. USING AND EXTENDING THE
- Page 156 and 157: APPENDIX B. CONTENTS OF CD-ROM 140
- Page 158 and 159: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 160 and 161: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 162 and 163: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 164 and 165: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 166 and 167: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 168 and 169: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 170 and 171: APPENDIX C. FORMAL SPECIFICATIONS O
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