Differences From Artifact [b9da97b04a]:

To Artifact [f745425625]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %% Revision 1.7  2000/05/19 17:46:17  peterg
# %% Give argument to state
# %%
# %% Revision 1.6  2000/05/19 14:59:03  peterg
# %% MTT --> mtt in fun output
# %%
# %% Revision 1.5  2000/05/19 14:05:10  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.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
# %% MTT --> mtt in fun output
# %%
# %% Revision 1.5  2000/05/19 14:05:10  peterg
140
141
142
143
144
145
146

147
148
149
150
151
152
153
      echo "%% $2 file ($1_$2.m)" >> $1_$2.m
      echo "%% Generated by MTT at `date`" >> $1_$2.m
      echo "% Global variable list" >>  $1_$2.m
      sympar2global_txt2m $1 >> $1_$2.m
      ;;
esac


#Write out the variables in m format.
cat  $1_$2.txt | grep -v METHOD |\
awk -F#  'BEGIN{
quote = "\047";
doublequote = "\042";
}
{







>







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
      echo "%% $2 file ($1_$2.m)" >> $1_$2.m
      echo "%% Generated by MTT at `date`" >> $1_$2.m
      echo "% Global variable list" >>  $1_$2.m
      sympar2global_txt2m $1 >> $1_$2.m
      ;;
esac

if [ "$representation" = "simpar" ]; then
#Write out the variables in m format.
cat  $1_$2.txt | grep -v METHOD |\
awk -F#  'BEGIN{
quote = "\047";
doublequote = "\042";
}
{
188
189
190
191
192
193
194


195

196
197
198
199






















200
     -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' \
     -e 's/#/%/g' \
>> $1_$2.m





if [ "$2" = "numpar" ]; then
   echo "## Set up the parameter vector"  >> $1_numpar.m;
   echo "mttpar = []; # Default to empty matrix (Remove in mtt_m2p)"  >> $1_numpar.m;
   sympar2par_txt2m $1 set   >> $1_numpar.m;






















fi







>
>

>
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
     -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' \
     -e 's/#/%/g' \
>> $1_$2.m

exit
fi


#if [ "$2" = "numpar" ]; then
#   echo "## Set up the parameter vector"  >> $1_numpar.m;
#   echo "mttpar = []; # Default to empty matrix (Remove in mtt_m2p)"  >> $1_numpar.m;
#   sympar2par_txt2m $1 set   >> $1_numpar.m;
#fi
case $2 in
    numpar)
         name=mttpar
	;;
    state)
         name=mttx
	;;
    input)
         name=mttu
	;;
    *)
esac
         
new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?`

if [ "$new_style" = "1" ]; then
  echo "## Set up the $name vector"  >> $1_$2.m;
  echo "name = []; # Default to empty matrix (Remove in mtt_m2p)"  >> $1_$2.m;
  mtt_name2array $1 $2 set   >> $1_$2.m
else
  echo "Old-style file detected: not creating array translations"  
fi

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]