Index: mttroot/mtt/bin/trans/mtt_r2m ================================================================== --- mttroot/mtt/bin/trans/mtt_r2m +++ mttroot/mtt/bin/trans/mtt_r2m @@ -14,10 +14,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.15 2000/02/10 14:58:57 peterg +## *** empty log message *** +## ## Revision 1.14 1999/12/08 02:06:00 peterg ## Now incudes csm rep. ## ## Revision 1.13 1999/11/23 00:59:14 peterg ## Now does ssm.m @@ -60,10 +63,25 @@ ## Initial revision ## ############################################################### +# Args +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -noglobal) + noglobal='-noglobal'; + ;; + -parameters) + parameters='-parameters'; + ;; + *) + echo $1 is an unknown option + exit;; + esac + shift +done # Set up the language specific stuff rep=$2 ext='m'; codegenerator='PASCAL' @@ -95,10 +113,14 @@ %Read the reduce definitions file in "$1_def.r"; %Read the reduce $REP file in "$1_$rep.r"; + +%Read the substitution file +in "$1_subs.r"; + EOF #Inform user echo Creating $outfile.m @@ -115,12 +137,12 @@ echo Creating $outfileo.m #rm -f $1_odea.$ext.1; #Header - lang_header $1 $rep $ext 'mttx,mttu,t' mttdx > $1_$2.p - lang_header $1 $2o $ext 'mttx,mttu,t' mtty > $1_$2o.p + lang_header $noglobal $parameters $1 $rep $ext 'mttx,mttu,mttt,mttpar' mttdx > $1_$2.p + lang_header $noglobal $parameters $1 $2o $ext 'mttx,mttu,mttt,mttpar' mtty > $1_$2o.p rm -f mtt_ode mtt_odeo # Use reduce to accomplish the transformation $SYMBOLIC > mtt_r2m.log < $outfile.p + lang_header $noglobal $parameters $1 $rep $ext '' [mtta,mttb,mttc,mttd] > $outfile.p Symbols='a b c d' fi if [ "$rep" = "dm" ]||[ "$rep" = "csm" ]; then #Header - lang_header $1 $rep $ext '' [mtta,mttb,mttc,mttd,mtte] > $outfile.p + lang_header $noglobal $parameters $1 $rep $ext '' [mtta,mttb,mttc,mttd,mtte] > $outfile.p Symbols='a b c d e' fi if [ "$rep" = "obs" ]; then # Is the system affine (look in the _obs.r file affine=`grep 'affine :=' $1_obs.r | awk '{print $3}' | sed 's/;//'` echo 'affine = ' $affine #Header if [ "$affine" = "1" ]; then - lang_header $1 obs m mttx [mttobs_o,mttobs_h] > $outfile.p + lang_header $noglobal $parameters $1 obs m mttx [mttobs_o,mttobs_h] > $outfile.p else - lang_header $1 obs m mttx,mttu mttyy > $outfile.p + lang_header $noglobal $parameters $1 obs m mttx,mttu mttyy > $outfile.p fi Symbols='obs_o obs_h' fi for Symbol in $Symbols; do