Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX E. ANTLR GRAMMAR prod_binding returns [ Binding b ] { b = null ; Binding b1 = null ; RSLListDefault b i n d i n g _ l i s t = new RSLListDefault() ; } : LPAREN b1 = binding { b i n d i n g _ l i s t . g e t L i s t ( ) . add ( b1 ) ; } ( COMMA b1 = binding { b i n d i n g _ l i s t . g e t L i s t ( ) . add ( b1 ) ; } ) ∗ RPAREN {b = new Make_ProductBinding ( new ProductBinding ( b i n d i n g _ l i s t ) ) ; } ; // Test D e c l a r a t i o n s t e s t _ d e c l returns [ TestDecl td ] { td = null ; RSLListDefault t e s t _ d e f _ l i s t = new RSLListDefault() ; TestDef def ; } : def = test_def { t e s t _ d e f _ l i s t . g e t L i s t ( ) . add ( def ) ; } ( COMMA def = test_def { t e s t _ d e f _ l i s t . g e t L i s t ( ) . add ( def ) ; } ) ∗ { td = new TestDecl ( t e s t _ d e f _ l i s t ) ; } ; test_def returns [ TestCase td ] { td = null ; Id i d e n t i f i e r = null ; ValueExpr ve = null ; } : LBRACKET i d e n t i f i e r = id RBRACKET ve = value_expr { td = new TestCase ( i d e n t i f i e r , ve ) ; } ; //Type Expression type_expr returns [ TypeExpr te ] { te = null ; FunctionArrow f a = null ; TypeExpr te2 = null ; TypeExpr te3 = null ; ResultDesc rd = null ; } : te2 = type_expr_pr2 486
; ( ( | TOTALARROW { f a = new TOTAL_FUNCTION_ARROW( ) ; } PARTIAL TOTALARROW { f a = new PARTIAL_FUNCTION_ARROW( ) ; } ) rd = r e s u l t _ d e s c { te = new FunctionTypeExpr ( te2 , fa , rd ) ; } ) ? { i f ( te == null ) te = te2 ; } type_expr_pr2 returns [ TypeExpr te ] { te = null ; TypeExpr te2 = null ; TypeExpr te3 = null ; RSLListDefault typeExprList = new RSLListDefault() ; } : te2 = type_expr_pr1 { typeExprList . g e t L i s t ( ) . add ( te2 ) ; } ( CROSS te3 = type_expr_pr1 { typeExprList . g e t L i s t ( ) . add ( te3 ) ; } ) ∗ { i f ( te3 ! = null ) { te = new TypeExprProduct ( typeExprList ) ; } else { te = te2 ; } } ; type_expr_pr1 returns [ TypeExpr te ] { te = null ; TypeExpr te2 = null ; TypeExpr te3 = null ; SingleTyping s t = null ; ValueExpr ve = null ; } : te2 = type_expr_primary ( MINUS ( LIST 487
- Page 452 and 453: APPENDIX D. SPECIFICATION OF TRANSF
- Page 454 and 455: APPENDIX D. SPECIFICATION OF TRANSF
- Page 456 and 457: APPENDIX D. SPECIFICATION OF TRANSF
- Page 458 and 459: APPENDIX D. SPECIFICATION OF TRANSF
- Page 460 and 461: APPENDIX D. SPECIFICATION OF TRANSF
- Page 462 and 463: APPENDIX D. SPECIFICATION OF TRANSF
- Page 464 and 465: APPENDIX D. SPECIFICATION OF TRANSF
- Page 466 and 467: APPENDIX D. SPECIFICATION OF TRANSF
- Page 468 and 469: APPENDIX D. SPECIFICATION OF TRANSF
- Page 470 and 471: APPENDIX D. SPECIFICATION OF TRANSF
- Page 472 and 473: APPENDIX D. SPECIFICATION OF TRANSF
- Page 474 and 475: APPENDIX D. SPECIFICATION OF TRANSF
- Page 476 and 477: APPENDIX D. SPECIFICATION OF TRANSF
- Page 478 and 479: APPENDIX D. SPECIFICATION OF TRANSF
- 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 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 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
APPENDIX E. ANTLR GRAMMAR<br />
prod_binding returns [ Binding b ] {<br />
b = null ;<br />
Binding b1 = null ;<br />
RSLListDefault b i n d i n g _ l i s t =<br />
new RSLListDefault() ;<br />
}<br />
: LPAREN b1 = binding<br />
{ b i n d i n g _ l i s t . g e t L i s t ( ) . add ( b1 ) ; }<br />
(<br />
COMMA b1 = binding<br />
{ b i n d i n g _ l i s t . g e t L i s t ( ) . add ( b1 ) ; }<br />
) ∗<br />
RPAREN<br />
{b = new Make_ProductBinding (<br />
new ProductBinding ( b i n d i n g _ l i s t ) ) ; }<br />
;<br />
// Test D e c l a r a t i o n s<br />
t e s t _ d e c l returns [ TestDecl td ] {<br />
td = null ;<br />
RSLListDefault t e s t _ d e f _ l i s t =<br />
new RSLListDefault() ;<br />
TestDef def ;<br />
}<br />
: def = test_def { t e s t _ d e f _ l i s t . g e t L i s t ( ) . add ( def ) ; }<br />
(<br />
COMMA def = test_def<br />
{ t e s t _ d e f _ l i s t . g e t L i s t ( ) . add ( def ) ; }<br />
) ∗<br />
{ td = new TestDecl ( t e s t _ d e f _ l i s t ) ; }<br />
;<br />
test_def returns [ TestCase td ] {<br />
td = null ;<br />
Id i d e n t i f i e r = null ;<br />
ValueExpr ve = null ;<br />
}<br />
: LBRACKET i d e n t i f i e r = id RBRACKET ve = value_expr<br />
{ td = new TestCase ( i d e n t i f i e r , ve ) ; }<br />
;<br />
//Type Expression<br />
type_expr returns [ TypeExpr te ] {<br />
te = null ;<br />
FunctionArrow f a = null ;<br />
TypeExpr te2 = null ;<br />
TypeExpr te3 = null ;<br />
ResultDesc rd = null ; }<br />
: te2 = type_expr_pr2<br />
486