26.09.2013 Views

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APPENDIX E. ANTLR GRAMMAR<br />

;<br />

d = d e c l<br />

{ d e c l _ l i s t . g e t L i s t ( ) . add ( d ) ; }<br />

) ∗<br />

END<br />

{be = new BasicClassExpr ( d e c l _ l i s t ) ; }<br />

extending_class_expr returns [ ExtendingClassExpr ece ] {<br />

ece = null ;<br />

ClassExpr ce1 = null ;<br />

ClassExpr ce2 = null ;<br />

}<br />

: EXTEND ce1 = class_expr WITH ce2 = class_expr<br />

{ ece = new ExtendingClassExpr ( ce1 , ce2 ) ; }<br />

;<br />

scheme_instantiation returns [ SchemeInstantiation s i ] {<br />

s i = null ;<br />

Id i d e n t i f i e r = null ;<br />

}<br />

: i d e n t i f i e r = id<br />

{ s i = new SchemeInstantiation ( i d e n t i f i e r ) ; }<br />

;<br />

d e c l returns [ Decl d ] {<br />

d = null ;<br />

}<br />

: VALUE d = value_decl<br />

| TYPE d = type_decl<br />

| TEST_CASE d = t e s t _ d e c l<br />

;<br />

//Type D e c l a r a t i o n<br />

type_decl returns [ TypeDecl td ] {<br />

td = null ;<br />

RSLListDefault<br />

type_def_list =<br />

new RSLListDefault() ;<br />

TypeDef def ;<br />

}<br />

: def = type_def<br />

{ type_def_list . g e t L i s t ( ) . add ( def ) ; }<br />

(<br />

COMMA def = type_def<br />

{ type_def_list . g e t L i s t ( ) . add ( def ) ; }<br />

) ∗<br />

{ td = new TypeDecl ( type_def_list ) ; }<br />

;<br />

478

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!