Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX F. SOURCE CODE } r e s u l t . append ( " ) " ) ; public void v i s i t M a k e L i s t P a t t e r n L e t ( MakeListPatternLet l i s t P a t t e r n ) { l i s t P a t t e r n . l i s t _ p a t t e r n ( ) . accept ( this ) ; } public void v i s i t M a k e L i s t P a t t e r n ( MakeListPattern l i s t P a t t e r n ) { l i s t P a t t e r n . l i s t _ p a t t e r n ( ) . accept ( this ) ; } public void visitMake_EnumeratedListPattern ( Make_EnumeratedListPattern enumListPattern ) { enumListPattern . enum_list_pattern ( ) . accept ( this ) ; } public void v i s i t C o n c a t e n a t e d L i s t P a t t e r n ( ConcatenatedListPattern c o n c a t L i s t P a t t e r n ) { c o n c a t L i s t P a t t e r n . c_enum_list_pattern ( ) . accept ( this ) ; r e s u l t . append ( " ^ " ) ; c o n c a t L i s t P a t t e r n . c_inner_pattern ( ) . accept ( this ) ; } public void visitEnumeratedListPattern ( EnumeratedListPattern enumListPattern ) { r e s u l t . append ( "" ) ; } public void v i s i t I n n e r P a t t e r n L i s t ( I n n e r P a t t e r n L i s t i n n e r P a t t e r n L i s t ) { for ( Pattern pattern : i n n e r P a t t e r n L i s t . p a t t e r n _ l i s t ( ) . g e t L i s t ( ) ) { pattern . accept ( this ) ; r e s u l t . append ( " , " ) ; } i f ( i n n e r P a t t e r n L i s t . p a t t e r n _ l i s t ( ) . l e n ( ) > 0) { r e s u l t . d e l e t e ( r e s u l t . length ( ) − 2 , r e s u l t . length ( ) ) ; } } public void v i s i t N o I n n e r P a t t e r n ( NoInnerPattern noInnerPattern ) {} public void v i s i t V a l u e L i t e r a l P a t t e r n ( V a l u e L i t e r a l P a t t e r n pattern ) { pattern . v a l u e _ l i t e r a l ( ) . accept ( this ) ; 550
} F.2. VISITOR MODULES public void visitNamePattern ( NamePattern pattern ) { pattern . id ( ) . accept ( this ) ; } public void v i s i t W i l d c a r d P a t t e r n ( WildcardPattern pattern ) { r e s u l t . append ( "_" ) ; } public void v i s i t P r o d u c t P a t t e r n ( ProductPattern pattern ) { r e s u l t . append ( " ( " ) ; for ( Pattern p : pattern . p_inner_pattern_list ( ) . g e t L i s t ( ) ) { p . accept ( this ) ; r e s u l t . append ( " , " ) ; } i f ( pattern . p_inner_pattern_list ( ) . l e n ( ) > 0) { r e s u l t . d e l e t e ( r e s u l t . l ength ( ) − 2 , r e s u l t . length ( ) ) ; } r e s u l t . append ( " ) " ) ; } public void v i s i t R e c o r d P a t t e r n ( RecordPattern pattern ) { pattern . value_or_variable_name ( ) . accept ( this ) ; r e s u l t . append ( " ( " ) ; for ( Pattern p : pattern . i n n e r _ p a t t e r n _ l i s t ( ) . g e t L i s t ( ) ) { p . accept ( this ) ; r e s u l t . append ( " , " ) ; } i f ( pattern . i n n e r _ p a t t e r n _ l i s t ( ) . l e n ( ) > 0) { r e s u l t . d e l e t e ( r e s u l t . l ength ( ) − 2 , r e s u l t . length ( ) ) ; } r e s u l t . append ( " ) " ) ; } public void v i s i t I f E x p r ( IfExpr ifExpr ) { r e s u l t . append ( " i f " ) ; ifExpr . c o n d i t i o n ( ) . accept ( this ) ; r e s u l t . append ( " then " ) ; ifExpr . i f _ c a s e ( ) . accept ( this ) ; for ( E l s i f e l s i f : ifExpr . e l s i f _ l i s t ( ) . g e t L i s t ( ) ) { e l s i f . accept ( this ) ; } r e s u l t . append ( " e l s e " ) ; ifExpr . e l s e _ c a s e ( ) . accept ( this ) ; r e s u l t . append ( " end" ) ; } public void v i s i t E l s i f ( E l s i f e l s i f ) { 551
- 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 530 and 531: APPENDIX F. SOURCE CODE F.2 Visitor
- 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 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
APPENDIX F. SOURCE CODE<br />
}<br />
r e s u l t . append ( " ) " ) ;<br />
public void v i s i t M a k e L i s t P a t t e r n L e t ( MakeListPatternLet l i s t P a t t e r n )<br />
{<br />
l i s t P a t t e r n . l i s t _ p a t t e r n ( ) . accept ( this ) ;<br />
}<br />
public void v i s i t M a k e L i s t P a t t e r n ( MakeListPattern l i s t P a t t e r n ) {<br />
l i s t P a t t e r n . l i s t _ p a t t e r n ( ) . accept ( this ) ;<br />
}<br />
public void visitMake_EnumeratedListPattern (<br />
Make_EnumeratedListPattern<br />
enumListPattern ) {<br />
enumListPattern . enum_list_pattern ( ) . accept ( this ) ;<br />
}<br />
public void v i s i t C o n c a t e n a t e d L i s t P a t t e r n ( ConcatenatedListPattern<br />
c o n c a t L i s t P a t t e r n ) {<br />
c o n c a t L i s t P a t t e r n . c_enum_list_pattern ( ) . accept ( this ) ;<br />
r e s u l t . append ( " ^ " ) ;<br />
c o n c a t L i s t P a t t e r n . c_inner_pattern ( ) . accept ( this ) ;<br />
}<br />
public void visitEnumeratedListPattern ( EnumeratedListPattern<br />
enumListPattern ) {<br />
r e s u l t . append ( "" ) ;<br />
}<br />
public void v i s i t I n n e r P a t t e r n L i s t ( I n n e r P a t t e r n L i s t<br />
i n n e r P a t t e r n L i s t ) {<br />
for ( Pattern pattern :<br />
i n n e r P a t t e r n L i s t . p a t t e r n _ l i s t ( ) . g e t L i s t ( ) ) {<br />
pattern . accept ( this ) ;<br />
r e s u l t . append ( " , " ) ;<br />
}<br />
i f ( i n n e r P a t t e r n L i s t . p a t t e r n _ l i s t ( ) . l e n ( ) > 0) {<br />
r e s u l t . d e l e t e ( r e s u l t . length ( ) − 2 , r e s u l t . length ( ) ) ;<br />
}<br />
}<br />
public void v i s i t N o I n n e r P a t t e r n ( NoInnerPattern noInnerPattern ) {}<br />
public void v i s i t V a l u e L i t e r a l P a t t e r n ( V a l u e L i t e r a l P a t t e r n<br />
pattern ) {<br />
pattern . v a l u e _ l i t e r a l ( ) . accept ( this ) ;<br />
550