Overview
Comment:*** empty log message ***
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a1151ccca5bcec44befabf8038c211d6c2bdc67e9cc45724f3f369627547366e
User & Date: gawthrop@users.sourceforge.net on 2000-12-05 09:04:54
Other Links: branch diff | manifest | tags
Context
2000-12-05
09:47:50
Include crs as c files check-in: cdab5d5f31 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:04:54
*** empty log message *** check-in: a1151ccca5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:04:08
Fixed function () compatibility problem. check-in: 7fe1ae8b97 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/cbg2ese_m2r from [f835ebd14a] to [0f74549f73].

12
13
14
15
16
17
18






19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+
+
+
+
+
+








###############################################################
## Version control history
###############################################################
## $Id$
##
## $Log$
## Revision 1.25  2000/12/01 14:51:26  peterg
## Major changes towards partioning
##
## - generates sub ese, def and struc
## - generates indices for conversion of subsystem in/out/state - but not used yet
##
## Revision 1.24  2000/11/30 15:12:55  peterg
## Zapped the declaration of subsystem connections - now in individual
## .def files
##
## Revision 1.23  2000/11/30 15:07:28  peterg
## Sorted out mtt_getsize
##
213
214
215
216
217
218
219







































220
221
222
223
224
225
226
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







  structure(7) = $Nuc; # Connecting inputs

  makedef(structure,deffilenum);  #Create definitions
EOF

echo "END;" >> $1_def.r
}


function get_indices {
  sys=$1
  which=$2
  awk '{if ($1==which) print $2}' which=$which < ${sys}_struc.txt
}

function convert_indices {
  sys=$1
  Which="input output state"
  for which in $Which; do
  
    indices=`get_indices ${sys} $which`
  
    case $which in
      input)
  	name=u
  	;;
      output)
  	name=y
  	;;
      state)
  	name=x
  	;;
      *)
  	
    esac
  
    new=0
    for old in $indices; do
      new=`expr $new + 1`
      pattern="MTT${name}(${old},1)"
      replacement="MTT${name}(${new},1)"
      mv ${sys}_ese.r mtt_junk
      sed "s/$pattern/$replacement/" <mtt_junk >${sys}_ese.r
    done
  done
}
  # Find subsystems
  subsystems=`mtt_get_subsystems $1`

  # Top level  
  makedef $1;
  echo "END;" >> $1_ese.r

245
246
247
248
249
250
251
252

253
254
255
256
257
258
259

260
261
262
263
264



265
266
267
268
269
270
271
290
291
292
293
294
295
296

297
298



299
300

301





302
303
304
305
306
307
308
309
310
311







-
+

-
-
-


-
+
-
-
-
-
-
+
+
+







  ## Subsystems (Only works when no repetitions at this level)
  esefile=${subsystem}_ese.r
  echo Creating $esefile
  cat ${subsystem}_1_ese.r ${subsystem}_1_*_ese.r > $esefile 2> /dev/null
  echo "END;" >> $esefile

  ## Def file for subsystem
  #makedef ${subsystem}
  makedef ${subsystem}
  
  echo Creating ${subsystem}_def.r
  cp mtt_all_def.r ${subsystem}_def.r

  echo Creating ${subsystem}_struc.txt
  grep $subsystem < $1_struc.txt > ${subsystem}_struc.txt
  echo "Creating indices (needs more work to convert subsystem indices)"

  whichs="input output state"
  for which in $whichs; do
    indices=`mtt_get_subindex $subsystem $which`
    echo "  $which $indices"
  done
  echo Converting subsystem indices
  convert_indices ${subsystem}

  done

fi


# Create the _alised file
touch mtt_aliased.txt


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