Overview
Comment:Got rid of sys_name functions with no ()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 1b31a9a0329a0f13539ae0daa0507fad005f1823d4275d8e54a79919ef213a21
User & Date: gawthrop@users.sourceforge.net on 2000-11-10 09:38:30
Other Links: branch diff | manifest | tags
Context
2000-11-10
14:19:50
Corrected the csex and cseo functions check-in: 5137561f9f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:38:30
Got rid of sys_name functions with no () check-in: 1b31a9a032 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:29:31
Changed the name regexp to be at least 3 characters long
- avoids problem translating som state files - but needs more work
check-in: d6b859cbef user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_m2p from [5b7619d9cf] to [d8f6703ed9].

11
12
13
14
15
16
17




18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1998

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




## 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







>
>
>
>







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

{*** 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_]*"
  fun_name="$Sys\_$name"
  mttfun_name=$name
  tab='	'
  space="[ $tab]*"
  spaces="[ $tab][ $tab]*"
  non_space="[^ ]*"
  args='[a-zA-Z0-9,._"]*'







|







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_]*"
  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
          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);







<

<







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\)(\($args\))/\2(\1,\3)/" |\

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);


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