11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
+
+
+
+
|
# Copyright (c) P.J.Gawthrop 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.59 2000/11/10 09:29:31 peterg
## Changed the name regexp to be at least 3 characters long
## - avoids problem translating som state files - but needs more work
##
## Revision 1.58 2000/10/17 09:54:29 peterg
## replaced switchopen by logic
##
## Revision 1.57 2000/10/15 10:35:35 peterg
## Fixed _input.p header
##
## Revision 1.56 2000/10/14 09:14:24 peterg
|
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
|
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
-
+
|
{*** System $Sys, rep $rep, language Pascal, file $Filename ***}
{*** Translated by MTT from $Sys_rep.m on `date` ***}
EOF
# Regexps
name="[a-zA-Z0-9_][a-zA-Z0-9_][a-zA-Z0-9_]*"
name="[a-zA-Z0-9_]*"
fun_name="$Sys\_$name"
mttfun_name=$name
tab=' '
space="[ $tab]*"
spaces="[ $tab][ $tab]*"
non_space="[^ ]*"
args='[a-zA-Z0-9,._"]*'
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
|
-
-
|
if (NF>1) printf("{* %s *}", $2)
printf("\n")
}' |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)/\2(\1)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\(zeros\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)/\2(\1)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)/\2(\1)/" |\
awk '
function printvar(Name,N) {
if (N<1) return;
width = 10;
kk = 0;
for (k=1;k<=N;k++) {
printf("mtt%s%i", Name, k);
|