Index: mttroot/mtt/bin/trans/mtt_m2p ================================================================== --- mttroot/mtt/bin/trans/mtt_m2p +++ mttroot/mtt/bin/trans/mtt_m2p @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 1998/07/25 09:42:52 peterg +## Initial revision +## ############################################################### # Set up variables @@ -74,11 +77,12 @@ echo "VAR" echo " t,LAST,DT : REAL;" echo " mttx,mttdx : StateVector;" echo " mttu : InputVector;" echo " mtty : OutputVector;" - echo " i,j,k,it,iLast,STEPFACTOR,METHOD : INTEGER;" + echo " i,j,k,it,iLast,STEPFACTOR : INTEGER;" + echo " METHOD : STRING;" ;; *) echo "PROCEDURE $Sys_rep;" ;; esac) > $Filename @@ -151,19 +155,17 @@ else printf("%s\n", $0) } else { if ($1=="if") { - print tolower($0) - print "begin" + print tolower($0) " begin" } else{ if ($1=="for"){ sub(/:/," TO ",$0) sub(/=/,":=",$0) - printf("%s DO\n", $0) - print "begin" + printf("%s DO\n", $0) " begin" } else { sub(/=/,":=",$0) sub(/\^/,"**",$0) printf("%s\n",$0) @@ -184,9 +186,11 @@ }' sys=$sys rep=$rep Nx=$Nx Nu=$Nu |\ sed 's/(\([0-9]*\))/\[\1\]/' \ >> $Filename # p2c doesn't like mixed case filenames! -echo Creating $filename -cp $Filename $filename +if [ "$Filename" != "$filename" ]; then + echo Creating $filename + cp -f $Filename $filename +fi