Overview
Comment:Fixed symbolic parameter bug.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 949b025103db19224d021e157c75f9d49af894ff8052bfdaaaaf872ba90b87cb
User & Date: gawthrop@users.sourceforge.net on 1996-12-07 20:02:43
Other Links: branch diff | manifest | tags
Context
1996-12-07
20:50:16
*** empty log message *** check-in: 97975b3c65 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
20:02:43
Fixed symbolic parameter bug. check-in: 949b025103 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
19:39:51
Minor debugging. check-in: b339ac0d20 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/awk/lbl2sympar.awk from [b36f691378] to [6910d204e4].

8
9
10
11
12
13
14



15
16
17
18
19
20
21
# Copyright (c) P.J.Gawthrop, 1996.

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



# Revision 1.4  1996/08/30  18:45:32  peter
# Removed header stuff.
#
## Revision 1.3  1996/08/30 10:30:54  peter
## Switched order of args in matches.
##
## Revision 1.2  1996/08/30 09:35:10  peter







>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5  1996/12/07 18:06:50  peterg
## Now detects symbolic args ($1 etc) and ignores them.
##
# Revision 1.4  1996/08/30  18:45:32  peter
# Removed header stuff.
#
## Revision 1.3  1996/08/30 10:30:54  peter
## Switched order of args in matches.
##
## Revision 1.2  1996/08/30 09:35:10  peter
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
sys_name = ARGV[1];
comment = "%";
arg_delimiter = ",";
not_an_arg = "effort flow state internal external zero 0 1";
numeric = "[0-9]";
symbol_count = 0;
symbols = "";
symbolic_arg_char = "$";
}
{
  if ( (match($1,comment)==0) && (NF>=3) ) {
# The following line is a bad attempt to use parameters in SS fields
# It assumes that at least one SS field is not_an_arg.
    if (matches(not_an_arg,$3)) {
      args = $2
	}
    else {
      args = $3;
    }
    n_args = split(args,arg,arg_delimiter);
    for (i = 1; i <= n_args; i++) {
      first_char = substr(arg[i],1,1);
      if ( (matches(not_an_arg,arg[i])==0) \
	   && (match(first_char,numeric)==0) \
	   && (match(first_char,symbolic_arg_char)==0) \
	   && (length(arg[i])>0) \
	   && (matches(symbols,arg[i]) ==0) ) {
	symbol_count++;
	symbols = sprintf("%s %s", symbols, arg[i]);
	  }
    }
  }







<
















|







52
53
54
55
56
57
58

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
sys_name = ARGV[1];
comment = "%";
arg_delimiter = ",";
not_an_arg = "effort flow state internal external zero 0 1";
numeric = "[0-9]";
symbol_count = 0;
symbols = "";

}
{
  if ( (match($1,comment)==0) && (NF>=3) ) {
# The following line is a bad attempt to use parameters in SS fields
# It assumes that at least one SS field is not_an_arg.
    if (matches(not_an_arg,$3)) {
      args = $2
	}
    else {
      args = $3;
    }
    n_args = split(args,arg,arg_delimiter);
    for (i = 1; i <= n_args; i++) {
      first_char = substr(arg[i],1,1);
      if ( (matches(not_an_arg,arg[i])==0) \
	   && (match(first_char,numeric)==0) \
	   && (match(arg[i],"\\$")==0) \
	   && (length(arg[i])>0) \
	   && (matches(symbols,arg[i]) ==0) ) {
	symbol_count++;
	symbols = sprintf("%s %s", symbols, arg[i]);
	  }
    }
  }


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