Overview
| Comment: | Set array code in input rep |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | origin/master | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
fbc85a519d4bab6b97896193e4f47935 |
| User & Date: | gawthrop@users.sourceforge.net on 2000-10-15 09:51:50.000 |
| Other Links: | branch diff | manifest | tags |
Context
|
2000-10-15
| ||
| 10:35:35 | Fixed _input.p header check-in: c8c9db41cc user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
| 09:51:50 | Set array code in input rep check-in: fbc85a519d user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
| 09:30:31 | *** empty log message *** check-in: 2f85b78d0c user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/mtt_txt2m
from [f745425625]
to [1ec24a214e].
| ︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ # %% Revision 1.8 2000/09/30 13:53:07 peterg # %% Default to empty matix in numpar.m -- avoids probs for parameter-free systems # %% # %% Revision 1.7 2000/05/19 17:46:17 peterg # %% Give argument to state # %% # %% Revision 1.6 2000/05/19 14:59:03 peterg | > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ # %% Revision 1.9 2000/10/13 11:07:33 peterg # %% Started conversion to new style state, input ext # %% # %% Revision 1.8 2000/09/30 13:53:07 peterg # %% Default to empty matix in numpar.m -- avoids probs for parameter-free systems # %% # %% Revision 1.7 2000/05/19 17:46:17 peterg # %% Give argument to state # %% # %% Revision 1.6 2000/05/19 14:59:03 peterg |
| ︙ | ︙ | |||
104 105 106 107 108 109 110 | # %% Revision 1.1 1998/02/25 22:10:25 peterg # %% Initial revision # %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% system=$1 representation=$2 | | < < < < < < < < | | | | < | > > | | < | > > | | | | | > | > | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# %% Revision 1.1 1998/02/25 22:10:25 peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
system=$1
representation=$2
outfile=$1_$2.m
# Inform user
echo Creating $1_$2.m
#Create the rep file complete with headers.
case $representation in
simpar)
arraycode=no
;;
numpar)
name=mttpar
arraycode=yes
;;
state)
name=mttx
arraycode=yes
;;
input)
name=mttu
arraycode=yes
;;
*)
echo Representation $representation not supported
exit
#echo "function $name = $1_$2$arg" > $outfile
#echo "%% $2 file ($1_$2.m)" >> $outfile
#echo "%% Generated by MTT at `date`" >> $outfile
#echo "% Global variable list" >> $outfile
#sympar2global_txt2m $1 >> $outfile
;;
esac
# Generate the header
mtt_header $system $representation m > $outfile
# Write out the code from the txt file
cat $1_$2.txt | strip_comments | grep -v METHOD |\
awk -F# 'BEGIN{
quote = "\047";
doublequote = "\042";
}
{
N=split($1,a,"=");
if (N==2) {
|
| ︙ | ︙ | |||
181 182 183 184 185 186 187 |
}
else if (match($1,"global")==1) {
statement = tolower($1); # Lower case globals as well
}
else
statement = $1;
| | < | < < | < < < < < < < < < < < < < < < < < < < | | > | | | | | | > > > > > > | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
}
else if (match($1,"global")==1) {
statement = tolower($1); # Lower case globals as well
}
else
statement = $1;
if (NF<2) print " " statement
if (NF>1) print statement " # " $2
}' | sed\
-e 's/\[\([0-9]*\)\]/(\1)/g' \
-e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \
-e 's/x(/mttx(/g' \
-e 's/u(/mttu(/g' \
-e 's/mttmtt/mtt/g' \
>> $outfile
if [ "$arraycode" = "yes" ]; then
new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?`
if [ "$new_style" = "1" ]; then
echo >> $outfile
echo " ## Set up the $name vector" >> $outfile
echo " $name = []; # Default to empty matrix (Remove in mtt_m2p)" >> $outfile
mtt_name2array $1 $2 set >> $outfile
else
echo "Old-style file detected: not creating array translations"
fi
fi
# End of the function
echo '## END Code' >> $outfile
echo 'endfunction' >> $outfile
|