Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX F. SOURCE CODE F.2 Visitor Modules RSLElement.java package t r a n s l a t o r . l i b ; import t r a n s l a t o r . r s l a s t . ∗ ; import t r a n s l a t o r . ∗ ; public abstract class RSLElement { } public abstract void accept ( RSLAstVisitor v i s i t o r ) ; RSLAstVisitor.java package t r a n s l a t o r . l i b ; import t r a n s l a t o r . r s l a s t . ∗ ; public abstract class RSLAstVisitor { public void visitRSLAst ( RSLAst r s l a s t ) { r s l a s t . libmodule ( ) . accept ( this ) ; } public void visitLibModule ( LibModule module ) { for ( Id id : module . c o n t e x t _ l i s t ( ) . g e t L i s t ( ) ) { id . accept ( this ) ; } module . schemedef ( ) . accept ( this ) ; } public void visitSchemeDef ( SchemeDef scheme ) { scheme . id ( ) . accept ( this ) ; scheme . class_expr ( ) . accept ( this ) ; } public void v i s i t B a s i c C l a s s E x p r ( BasicClassExpr basicClassExpr ) { for ( Decl d e c l : basicClassExpr . d e c l a r a t i o n _ l i s t ( ) . g e t L i s t ( ) ) { d e c l . accept ( this ) ; } } 514
F.2. VISITOR MODULES public void visitExtendingClassExpr ( ExtendingClassExpr extendingClassExpr ) { extendingClassExpr . base_class ( ) . accept ( this ) ; extendingClassExpr . e x t e n s i o n _ c l a s s ( ) . accept ( this ) ; } public void v i s i t S c h e m e I n s t a n t i a t i o n ( SchemeInstantiation s c h e m e I n s t a n t i a t i o n ) { s c h e m e I n s t a n t i a t i o n . id ( ) . accept ( this ) ; } /∗Type D e c l a r a t i o n s ∗/ public void visitTypeDecl ( TypeDecl typeDecl ) { for ( TypeDef typeDef : typeDecl . type_def_list ( ) . g e t L i s t ( ) ) { typeDef . accept ( this ) ; } } public void v i s i t S o r t D e f ( SortDef s o r t D e f ) { s o r t D e f . sd_id ( ) . accept ( this ) ; } public void v i s i t V a r i a n t D e f ( VariantDef variantDef ) { variantDef . id ( ) . accept ( this ) ; for ( Variant v a r i a n t : variantDef . v a r i a n t _ l i s t ( ) . g e t L i s t ( ) ) { v a r i a n t . accept ( this ) ; } } public void v i s i t U n i o n D e f ( UnionDef unionDef ) { unionDef . ud_id ( ) . accept ( this ) ; for ( NameOrWildcard nameOrWildcard : unionDef . name_or_wildcard_list ( ) . g e t L i s t ( ) ) { nameOrWildcard . accept ( this ) ; } } public void v i s i t S h o r t R e c o r d D e f ( ShortRecordDef shortRecordDef ) { shortRecordDef . srd_id ( ) . accept ( this ) ; for ( ComponentKind componentKind : shortRecordDef . component_kind_string ( ) . g e t L i s t ( ) ) { componentKind . accept ( this ) ; } } public void v i s i t A b b r e v i a t i o n D e f ( AbbreviationDef abbreviationDef ) { abbreviationDef . abbr_id ( ) . accept ( this ) ; abbreviationDef . type_expr ( ) . accept ( this ) ; } 515
- Page 480 and 481: APPENDIX D. SPECIFICATION OF TRANSF
- Page 482 and 483: APPENDIX D. SPECIFICATION OF TRANSF
- Page 484 and 485: APPENDIX D. SPECIFICATION OF TRANSF
- Page 486 and 487: APPENDIX D. SPECIFICATION OF TRANSF
- Page 488 and 489: APPENDIX D. SPECIFICATION OF TRANSF
- Page 490 and 491: APPENDIX D. SPECIFICATION OF TRANSF
- Page 492 and 493: APPENDIX E. ANTLR GRAMMAR END = "en
- Page 494 and 495: APPENDIX E. ANTLR GRAMMAR ; d = d e
- Page 496 and 497: APPENDIX E. ANTLR GRAMMAR ; } ( com
- Page 498 and 499: APPENDIX E. ANTLR GRAMMAR ; ) ∗ }
- Page 500 and 501: APPENDIX E. ANTLR GRAMMAR ; } else
- Page 502 and 503: APPENDIX E. ANTLR GRAMMAR prod_bind
- Page 504 and 505: APPENDIX E. ANTLR GRAMMAR ; | | | |
- Page 506 and 507: APPENDIX E. ANTLR GRAMMAR ; | NAT {
- Page 508 and 509: APPENDIX E. ANTLR GRAMMAR ; { ve3 =
- Page 510 and 511: APPENDIX E. ANTLR GRAMMAR ( | RPARE
- Page 512 and 513: APPENDIX E. ANTLR GRAMMAR | { optio
- Page 514 and 515: APPENDIX E. ANTLR GRAMMAR new RSLLi
- Page 516 and 517: APPENDIX E. ANTLR GRAMMAR infix_op_
- Page 518 and 519: APPENDIX E. ANTLR GRAMMAR : v l = v
- Page 520 and 521: APPENDIX E. ANTLR GRAMMAR } t e s t
- Page 522 and 523: APPENDIX E. ANTLR GRAMMAR } : ’ .
- Page 524 and 525: APPENDIX E. ANTLR GRAMMAR 508
- Page 526 and 527: APPENDIX F. SOURCE CODE System . e
- Page 528 and 529: APPENDIX F. SOURCE CODE } } catch (
- Page 532 and 533: APPENDIX F. SOURCE CODE public void
- Page 534 and 535: APPENDIX F. SOURCE CODE public void
- Page 536 and 537: APPENDIX F. SOURCE CODE public void
- Page 538 and 539: APPENDIX F. SOURCE CODE public void
- Page 540 and 541: APPENDIX F. SOURCE CODE public void
- Page 542 and 543: APPENDIX F. SOURCE CODE public void
- Page 544 and 545: APPENDIX F. SOURCE CODE public void
- Page 546 and 547: APPENDIX F. SOURCE CODE StringRSLAs
- Page 548 and 549: APPENDIX F. SOURCE CODE } nameOrWil
- Page 550 and 551: APPENDIX F. SOURCE CODE } public vo
- Page 552 and 553: APPENDIX F. SOURCE CODE } r e s u l
- Page 554 and 555: APPENDIX F. SOURCE CODE public void
- Page 556 and 557: APPENDIX F. SOURCE CODE } } public
- Page 558 and 559: APPENDIX F. SOURCE CODE } v a l u e
- Page 560 and 561: APPENDIX F. SOURCE CODE } public vo
- Page 562 and 563: APPENDIX F. SOURCE CODE } public vo
- Page 564 and 565: APPENDIX F. SOURCE CODE public void
- Page 566 and 567: APPENDIX F. SOURCE CODE } r e s u l
- Page 568 and 569: APPENDIX F. SOURCE CODE } } r e s u
- Page 570 and 571: APPENDIX G. TEST RESULTS continued
- Page 572 and 573: APPENDIX G. TEST RESULTS continued
- Page 574 and 575: APPENDIX G. TEST RESULTS continued
- Page 576: APPENDIX G. TEST RESULTS continued
F.2. VISITOR MODULES<br />
public void visitExtendingClassExpr ( ExtendingClassExpr<br />
extendingClassExpr ) {<br />
extendingClassExpr . base_class ( ) . accept ( this ) ;<br />
extendingClassExpr . e x t e n s i o n _ c l a s s ( ) . accept ( this ) ;<br />
}<br />
public void v i s i t S c h e m e I n s t a n t i a t i o n ( SchemeInstantiation<br />
s c h e m e I n s t a n t i a t i o n ) {<br />
s c h e m e I n s t a n t i a t i o n . id ( ) . accept ( this ) ;<br />
}<br />
/∗Type D e c l a r a t i o n s ∗/<br />
public void visitTypeDecl ( TypeDecl typeDecl ) {<br />
for ( TypeDef typeDef : typeDecl . type_def_list ( ) . g e t L i s t ( ) ) {<br />
typeDef . accept ( this ) ;<br />
}<br />
}<br />
public void v i s i t S o r t D e f ( SortDef s o r t D e f ) {<br />
s o r t D e f . sd_id ( ) . accept ( this ) ;<br />
}<br />
public void v i s i t V a r i a n t D e f ( VariantDef variantDef ) {<br />
variantDef . id ( ) . accept ( this ) ;<br />
for ( Variant v a r i a n t : variantDef . v a r i a n t _ l i s t ( ) . g e t L i s t ( ) ) {<br />
v a r i a n t . accept ( this ) ;<br />
}<br />
}<br />
public void v i s i t U n i o n D e f ( UnionDef unionDef ) {<br />
unionDef . ud_id ( ) . accept ( this ) ;<br />
for ( NameOrWildcard nameOrWildcard :<br />
unionDef . name_or_wildcard_list ( ) . g e t L i s t ( ) ) {<br />
nameOrWildcard . accept ( this ) ;<br />
}<br />
}<br />
public void v i s i t S h o r t R e c o r d D e f ( ShortRecordDef shortRecordDef ) {<br />
shortRecordDef . srd_id ( ) . accept ( this ) ;<br />
for ( ComponentKind componentKind :<br />
shortRecordDef . component_kind_string ( ) . g e t L i s t ( ) ) {<br />
componentKind . accept ( this ) ;<br />
}<br />
}<br />
public void v i s i t A b b r e v i a t i o n D e f ( AbbreviationDef abbreviationDef ) {<br />
abbreviationDef . abbr_id ( ) . accept ( this ) ;<br />
abbreviationDef . type_expr ( ) . accept ( this ) ;<br />
}<br />
515