Differences From Artifact [cc6de330d2]:

To Artifact [e652f8d2b9]:


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







+
+
+







# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.46  2000/05/16 11:59:01  peterg
## Updated for new data file parameter/state update
##
## Revision 1.45  2000/05/13 13:16:52  peterg
## Matrix initialisation for smxa
##
## Revision 1.44  2000/05/13 11:52:16  peterg
## A now matrix in smxa rep
##
## Revision 1.43  2000/05/11 19:35:16  peterg
342
343
344
345
346
347
348

349
350
351
352
353
354
355
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359







+







sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\
awk -F# '{printf("%s",$1) 
          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;
415
416
417
418
419
420
421

422
423
424
425
426
427
428
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433







+







          }
          printf("{%s %s_switchopen.p}\n\n",inc,Sys)

          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("\nBEGIN{%s}\n", Sys_rep)
          printf("  open(statefile,\"%s_state.dat\");\n", Sys)
          printf("  open(simparfile,\"%s_simpar.dat\");\n", Sys)
          printf("  open(numparfile,\"%s_numpar.dat\");\n", Sys)
        }
        else{
          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("VAR \n");
          for (k=1;k<i;k++) printf("  %s,\n",global[k])
460
461
462
463
464
465
466
467
468


469
470
471
472
473
474
475
465
466
467
468
469
470
471


472
473
474
475
476
477
478
479
480







-
-
+
+







          printf("%s THEN BEGIN\n", $0)
        }
        else { 
          if ((match($1,"mtt_write")>0)&&(length(Stdin)>0)) {
           sub(/mtt_write/, "if NOT eof THEN mtt_write");
          }
          if ($1=="for"){
            if (($2=="MTTit")&&(length(Stdin)>0)){
	      printf("WHILE NOT eof DO BEGIN {Integration loop}")
            if (($2=="it")&&(length(Stdin)>0)){
	      printf("WHILE NOT eof DO BEGIN {Integration loop}\n")
            }
            else {
              sub(/:/," TO ",$0)
              sub(/=/,":=",$0)
              printf("%s DO BEGIN\n", $0)
            } 
          }

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