Overview
Comment:Now has third argument for use in abg2lbl_fig2txt
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 85d7f0ef2b18e220932309165d497d5e36538f65c2883d7e9d16944577a408fe
User & Date: gawthrop@users.sourceforge.net on 2001-06-11 16:45:22
Other Links: branch diff | manifest | tags
Context
2001-06-11
16:53:49
Now uses abg2sympar_m2txt to get the arguments check-in: d986cfb484 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:45:22
Now has third argument for use in abg2lbl_fig2txt check-in: 85d7f0ef2b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:09:18
Removed spurious parameter check-in: 5e0ede0928 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/abg2sympar_m2txt from [1bc0ed0fd1] to [77f608f79b].

8
9
10
11
12
13
14
15
16
17
18
19










20
21

22
23
24
25
26
27
28

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







<




>
>
>
>
>
>
>
>
>
>

<
>







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

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

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


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

SystemName=$2
UseLabelFile=$3

if [ -n "$UseLabelFile" ]; then ## Take input from lbl.txt
     strip_comments < $1_lbl.txt | awk '{printf("%s %s \"%s\",\n",$1,$2,$3)}' > mtt_stripped_file
else ## Take input from _abg.m
     cat $1_abg.m | grep "arg =" | tr $SEPS $REPS > mtt_stripped_file
fi
rm -f mtt_error
# This is the main transformation using gawk

cat mtt_stripped_file | \
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);
47
48
49
50
51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
66
67
  arg_line = "arg = ";
}
{
  ## Explicit VAR declarations
  if (match($1,var)>0) print $2 "\t" system_name;

   ## Implicit declarations from the arg list
  if (match($1,"arg")>0) {
    args=substr($3,2,length($3)-3);
    if (length(args)>0)
      printf("%s\t%s\n", args,system_name)
  }

}' system_name=$2 |\
grep -v '^\$' | mtt_strip_args |\
sort -u #> $1_sympar.txt 2>mtt_error.txt

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










|
|


<
>
|








56
57
58
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
74
75
76
  arg_line = "arg = ";
}
{
  ## Explicit VAR declarations
  if (match($1,var)>0) print $2 "\t" system_name;

   ## Implicit declarations from the arg list
##  if (match($1,"arg")>0) {
    args= substr($3,2,length($3)-3);
    if (length(args)>0)
      printf("%s\t%s\n", args,system_name)

##  }
}' system_name=$SystemName |\
grep -v '^\$' | mtt_strip_args |\
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 ]