Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX A. USING AND EXTENDING THE TRANSFORMER A.2 Using the Transformer In order to transform a specification using the transformer the following command must be executed: java translator.RSLRunner RSL-file new-RSL-file [variable-list] where RSL-file is the name of an RSL file without the .rsl extension. new-RSL-file is the the file name without the .rsl extension to which the transformed specification is written. variable-list is a list of the form var1:type1 var2:type2... where var1 is the name of the variable that type1 should be represented by and so on. A.3 Extending the Transformer To extend the transformer the following programs need to be installed: • ANTLR, which can be found in www.antlr.org. • The RSL2Java tool, [Hja04]. An extension requires the following steps. The directories mentioned are relative to the source_code directory, which can be found on the enclosed CD-ROM. • Extension of the lexer and parser, which means an extension of the ANTLR grammar file translator\syntacticanalyzer\rsltorslast.g. • Extension of the RSL AST specification, RSLAst_Module.rsl. • Extension of the transformer specification, TransformerRSL1.rsl. • Extension of the visitor modules, translator\lib\RSLAstVisitor.java and translator\lib\StringRSLAstVisitor.java. When these extensions have been done the transformer must be generated. This is done as follows. • Generation of the lexer and the parser by executing the command java antlr.Tool rsltorslast.g in the directory translator\syntacticanalyzer. • Translation of the RSL AST into Java by executing the command java translator.Runner2 RSLAst_Module rslast.properties in the source_code directory. 136
A.3. EXTENDING THE TRANSFORMER • Translation of the transformer specification into Java by executing the command java translator.Runner2 TransformerRSL1 transformer.properties in the source_code directory. • Compiling all the Java source code by executing the command javac translator/lib/*.java translator/rslast/*.java translator/rsllib/*.java translator/*.java translator/syntacticanalyzer/*.java translator/rsltransformer/*.java in the source_code directory. An overview of the packages of the program and the destinations of the generated Java files can be found in Figure A.1 on the following page. 137
- 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 122 and 123: 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 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
- Page 172 and 173: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 174 and 175: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 176 and 177: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 178 and 179: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 180 and 181: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 182 and 183: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 184 and 185: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 186 and 187: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 188 and 189: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 190 and 191: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 192 and 193: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 194 and 195: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 196 and 197: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 198 and 199: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 200 and 201: APPENDIX C. FORMAL SPECIFICATIONS O
APPENDIX A. USING AND EXTENDING THE TRANSFORMER<br />
A.2 Using the Transformer<br />
In order to transform a specification using the transformer the following<br />
command must be executed:<br />
java translator.RSLRunner RSL-file new-RSL-file [variable-list]<br />
where RSL-file is the name <strong>of</strong> an RSL file without the .rsl extension.<br />
new-RSL-file is the the file name without the .rsl extension to which the<br />
transformed specification is written. variable-list is a list <strong>of</strong> the form<br />
var1:type1 var2:type2... where var1 is the name <strong>of</strong> the variable that<br />
type1 should be represented by and so on.<br />
A.3 Extending the Transformer<br />
To extend the transformer the following programs need to be installed:<br />
• ANTLR, which can be found in www.antlr.org.<br />
• The RSL2Java tool, [Hja04].<br />
An extension requires the following steps. The directories mentioned are<br />
relative to the source_code directory, which can be found on the enclosed<br />
CD-ROM.<br />
• Extension <strong>of</strong> the lexer and parser, which means an extension <strong>of</strong> the<br />
ANTLR grammar file translator\syntacticanalyzer\rsltorslast.g.<br />
• Extension <strong>of</strong> the RSL AST specification, RSLAst_Module.rsl.<br />
• Extension <strong>of</strong> the transformer specification, TransformerRSL1.rsl.<br />
• Extension <strong>of</strong> the visitor modules, translator\lib\RSLAstVisitor.java<br />
and translator\lib\StringRSLAstVisitor.java.<br />
When these extensions have been done the transformer must be generated.<br />
This is done as follows.<br />
• Generation <strong>of</strong> the lexer and the parser by executing the command<br />
java antlr.Tool rsltorslast.g<br />
in the directory translator\syntacticanalyzer.<br />
• Translation <strong>of</strong> the RSL AST <strong>into</strong> Java by executing the command<br />
java translator.Runner2 RSLAst_Module rslast.properties<br />
in the source_code directory.<br />
136