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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX E. ANTLR GRAMMAR<br />

;<br />

|<br />

|<br />

|<br />

|<br />

)<br />

{ te = new TypeExprList (<br />

new FiniteListTypeExpr ( te2 ) ) ; }<br />

INFLIST<br />

{ te = new TypeExprList (<br />

new I n f i n i t e L i s t T y p e E x p r ( te2 ) ) ; }<br />

SET<br />

{ te = new TypeExprSet (<br />

new FiniteSetTypeExpr ( te2 ) ) ; }<br />

INFSET<br />

{ te = new TypeExprSet (<br />

new InfiniteSetTypeExpr ( te2 ) ) ; }<br />

MAP te3 = type_expr_primary<br />

{ te = new TypeExprMap(<br />

new FiniteMapTypeExpr ( te2 , te3 ) ) ; }<br />

) ?<br />

{ i f ( te == null ) te = te2 ; }<br />

|<br />

LSET BAR s t = s i n g l e _ t y p i n g FORWHICH<br />

ve = value_expr BAR RSET<br />

{ te = new SubtypeExpr ( st , ve ) ; }<br />

r e s u l t _ d e s c returns [ ResultDesc rd ] {<br />

rd = null ;<br />

OptionalReadAccessDesc orad = null ;<br />

OptionalWriteAccessDesc owad = null ;<br />

TypeExpr te = null ;<br />

}<br />

: (READ orad = read_access_desc ) ?<br />

(WRITE owad = write_access_desc ) ?<br />

te = type_expr_pr2<br />

{ i f ( orad == null ) orad = new NoReadAccessMode ( ) ; }<br />

{ i f ( owad == null ) owad = new NoWriteAccessMode ( ) ; }<br />

{ rd = new ResultDesc ( orad , owad , te ) ; }<br />

;<br />

read_access_desc returns [ OptionalReadAccessDesc orad ] {<br />

orad = null ;<br />

Access a = null ;<br />

RSLListDefault a l =<br />

new RSLListDefault() ;<br />

}<br />

: a = a c c e s s { a l . g e t L i s t ( ) . add ( a ) ; }<br />

(<br />

488

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

Saved successfully!

Ooh no, something went wrong!