Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: f4fee488fc5ad7d106510a15fdbd8cdbf446e235af46203a0363fc8df95af606
User & Date: gawthrop@users.sourceforge.net on 2000-03-16 09:32:08
Other Links: branch diff | manifest | tags
Context
2000-03-16
09:43:35
Put in $mtt_switches in mtt comand line when creating _state.txt and
_input.txt
check-in: f0e171e923 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:32:08
Initial revision check-in: f4fee488fc user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2000-03-15
21:24:23
Version 4.1:
Fixed problems with -abg mode
Old-style SS lbl no longer supported
check-in: 6609327e89 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/abg2sympar_m2txt version [81b5367656].





























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
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
53
54
55
56
57
58
59
60
61
62
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: abg2sympar_m2txt

# Label file to symbolic parameters conversion
# Copyright (C) 2000 by Peter J. Gawthrop


# Inform user
echo "Creating $1_sympar.txt"

rm -f mtt_error
# Separation characters
SEPS=';+*/()-'
# Replace by ,
REPS=',,,,,,,'

# This is the main transformation using gawk
tr $SEPS $REPS <  $1_abg.m | \
awk '
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 {
  not_an_arg = "effort flow state internal external zero unknown 0 1";
  arg_line = "arg = ";
}
{
  if (match($1,"arg")>0) {
    args=substr($3,2,length($3)-3);
    N=split(args, arg, ",");
    for (i=1;i<=N;i++){
      if ( (length(arg[i])>0)&&(matches(not_an_arg,arg[i])==0) ){
        print arg[i];
      }
    }
  }
}' |\
sort -u > $1_sympar.txt 2>mtt_error.txt

# Now invoke the standard error handling.
mtt_error mtt_error.txt




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