Index: mttroot/mtt/bin/trans/cse2smx_lang ================================================================== --- mttroot/mtt/bin/trans/cse2smx_lang +++ mttroot/mtt/bin/trans/cse2smx_lang @@ -8,10 +8,27 @@ # Constrained-state equation to state matrices with x vector # Used for implicit integration # Copyright (C) 2000 by Peter J. Gawthrop ## Modified from eailier version + +# 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 + # Language if [ -n "$3" ]; then lang=$3 else lang="m" @@ -53,11 +70,11 @@ rm -f $1_smxx.$lang rm -f $1_smxtx.$lang rm -f $1_$rep.body # Use reduce to accomplish the transformation -reduce << EOF >cse2smx_lang.log +$SYMBOLIC << EOF >cse2smx_lang.log lang := $lang; in "$1_subs.r"; in "$1_def.r"; @@ -124,11 +141,11 @@ %Shut the output according to the language. GENTRANSHUT "$1_$rep.body"; EOF if [ "$lang" = "m" ]; then - lang_header $1 $rep m 'mttx,mttu,mttt,mttpar' $out > $1_$rep.m + lang_header $noglobals $parameters $1 $rep m 'mttx,mttu,mttt,mttpar' $out > $1_$rep.m echo '#====== Start of code ======#' >> $1_$rep.m cat $1_$rep.body | mtt_p2m >> $1_$rep.m fi