Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.19 2000/12/03 16:11:43 peterg +## Corrected bug in logic declatations +## ## Revision 1.18 2000/12/03 16:06:22 peterg ## Fixed bug in generating dummies ## Added logic declarations ## ## Revision 1.17 2000/12/01 20:55:01 peterg @@ -141,10 +144,11 @@ parameters=yes; output=mttopen args=$eqnargs declareinputs=yes declarestates=yes + declareswitches=yes ;; numpar) states=no; inputs=no; parameters=no; @@ -233,10 +237,11 @@ start='## BEGIN Code' finish='## END Code' var_declaration=$Lc declarestates=no declareinputs=no + declareswitches=no ;; txt) modeline='## -*-octave-*- Put Emacs into octave-mode ##'; Lc='##'; Rc=''; @@ -248,10 +253,11 @@ parameters=no states=no inputs=no declarestates=no declareinputs=no + declareswitches=no ;; oct) modeline="// -*-c++-*- Put Emacs into c++-mode"; Lc='//'; oct_header=yes; @@ -294,20 +300,21 @@ esac echo " mtt$name = zeros($N,$M);" done } + function declare_dummies(){ # Get the dummies dummies="mtt_tmp" rm -f mtt_dummies for dummy in $dummies; do grep "${dummy}[0-9]* " < ${fun_name}.m |\ awk '{ # if (match(dummy,$1)==1) print $1 - }' dummy=$dummy | sort -u >> mtt_dummies + }' dummy=$dummy >> mtt_dummies done dummy_list=`sort -u mtt_dummies` # Comments @@ -319,10 +326,18 @@ for dummy in $dummy_list; do echo ' ' $var_declaration $dummy';' done } # declare_dummies +function declare_switches { +cat <