Overview
Comment:Switched order of args in matches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a73ab7c4bc3cd42ddcdd9c399767e80b431d0c1e43c7d0067110ae5546549ee4
User & Date: gawthrop@users.sourceforge.net on 1996-08-30 10:30:54
Other Links: branch diff | manifest | tags
Context
1996-08-30
11:04:28
Changed line length to 500. check-in: a4906ec565 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:30:54
Switched order of args in matches. check-in: a73ab7c4bc user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:19:11
New path for awk script. check-in: ec039e50ba user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/awk/lbl2sympar.awk from [022588a53d] to [312581adf0].

8
9
10
11
12
13
14



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (c) P.J.Gawthrop, 1996.

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



## Revision 1.1  1996/08/24 13:34:48  peter
## Initial revision
##
###############################################################



function exact_match(name1, name2) {
  return ((match(name1,name2)>0)&&(length(name1)==length(name2)))
    }

function matches(name, names) {
  n_matches = split(names,match_name);
  matched = 0;
  for (i_matches = 1; i_matches <= n_matches; i_matches++) {
    if ( exact_match(name,match_name[i_matches]) ) {
      matched = 1;
      break;
    }
  }
  return matched;
    }


BEGIN {
comment = "%";
arg_delimiter = ",";
not_an_arg = "effort flow internal external zero";
numeric = "[0-9]";
symbol_count = 0;
symbols = "";
}
{
  if ( (match($1,comment)==0) && (NF>=3) ) {
    args = $3;







>
>
>











|















|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  1996/08/30 09:35:10  peter
## Fixed problem with global variable in function.
##
## Revision 1.1  1996/08/24 13:34:48  peter
## Initial revision
##
###############################################################



function exact_match(name1, name2) {
  return ((match(name1,name2)>0)&&(length(name1)==length(name2)))
    }

function matches(names, name) {
  n_matches = split(names,match_name);
  matched = 0;
  for (i_matches = 1; i_matches <= n_matches; i_matches++) {
    if ( exact_match(name,match_name[i_matches]) ) {
      matched = 1;
      break;
    }
  }
  return matched;
    }


BEGIN {
comment = "%";
arg_delimiter = ",";
not_an_arg = "effort flow state internal external zero";
numeric = "[0-9]";
symbol_count = 0;
symbols = "";
}
{
  if ( (match($1,comment)==0) && (NF>=3) ) {
    args = $3;
65
66
67
68
69
70
71
72
73
74
75
76
  printf("%% Symbolic parameter file - generated by MTT\n\n");
  printf("MTTNVar := %1.0f;\n", symbol_count);

  if (symbol_count>0) {
    printf("MATRIX MTTVar(MTTNVar,1);\n");
    split(symbols,symbol);
    for (i = 1; i <= symbol_count; i++) {
      printf("MTTVar(%1.0f,1) := %s;\n", i, symbol[i]);
    }
  }
  printf("END;\n\n");  
}







|




68
69
70
71
72
73
74
75
76
77
78
79
  printf("%% Symbolic parameter file - generated by MTT\n\n");
  printf("MTTNVar := %1.0f;\n", symbol_count);

  if (symbol_count>0) {
    printf("MATRIX MTTVar(MTTNVar,1);\n");
    split(symbols,symbol);
    for (i = 1; i <= symbol_count; i++) {
      printf("MTTVar(%1.0f,1) \t := %s;\n", i, symbol[i]);
    }
  }
  printf("END;\n\n");  
}


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