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 F. SOURCE CODE<br />

}<br />

public void v i s i t E x p l i c i t F u n c t i o n D e f ( E x p l i c i t F u n c t i o n D e f<br />

e x p l i c i t F u n c t i o n D e f ) {<br />

e x p l i c i t F u n c t i o n D e f . fun_single_typing ( ) . accept ( this ) ;<br />

r e s u l t . append ( "\n" ) ;<br />

e x p l i c i t F u n c t i o n D e f . formal_function_application ( ) . accept ( this ) ;<br />

r e s u l t . append ( " i s " ) ;<br />

e x p l i c i t F u n c t i o n D e f . fun_value_expr ( ) . accept ( this ) ;<br />

e x p l i c i t F u n c t i o n D e f . pre_cond ( ) . accept ( this ) ;<br />

}<br />

public void visitMake_SingleTyping ( Make_SingleTyping<br />

singleTyping ) {<br />

singleTyping . s i n g l e _ t y p i n g ( ) . accept ( this ) ;<br />

}<br />

public void visitMake_MultipleTyping ( Make_MultipleTyping<br />

multipleTyping ) {<br />

multipleTyping . multiple_typing ( ) . accept ( this ) ;<br />

}<br />

public void v i s i t S i n g l e T y p i n g ( SingleTyping singleTyping ) {<br />

singleTyping . binding ( ) . accept ( this ) ;<br />

r e s u l t . append ( " : " ) ;<br />

singleTyping . type_expr ( ) . accept ( this ) ;<br />

}<br />

public void v i s i t M u l t i p l e T y p i n g ( MultipleTyping multipleTyping ) {<br />

for ( Binding binding :<br />

multipleTyping . b i n d i n g _ l i s t ( ) . g e t L i s t ( ) ) {<br />

binding . accept ( this ) ;<br />

r e s u l t . append ( " , " ) ;<br />

}<br />

i f ( multipleTyping . b i n d i n g _ 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 />

r e s u l t . append ( " : " ) ;<br />

multipleTyping . type_expr ( ) . accept ( this ) ;<br />

}<br />

public void v i s i t I d A p p l i c a t i o n ( I d A p p l i c a t i o n i d A p p l i c a t i o n ) {<br />

i d A p p l i c a t i o n . id ( ) . accept ( this ) ;<br />

r e s u l t . append ( " ( " ) ;<br />

i d A p p l i c a t i o n . formal_function_parameter ( ) . accept ( this ) ;<br />

r e s u l t . append ( " ) " ) ;<br />

}<br />

public void visitFormalFunctionParameter ( FormalFunctionParameter<br />

534

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

Saved successfully!

Ooh no, something went wrong!