Overview
Comment:Operator ^ now ok in args in abg and/or lbl
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a45ac8a4e95d5da3a3dbaac10a65cd8a44bacf48d6e24311b85697b1b18b2119
User & Date: gawthrop@users.sourceforge.net on 2001-06-13 14:50:15
Other Links: branch diff | manifest | tags
Context
2001-06-13
14:53:59
MTT now gas the double-colon option in the abg.fig file
eg R:r:a^2+3*b
check-in: 8f7aea58de user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:50:15
Operator ^ now ok in args in abg and/or lbl check-in: a45ac8a4e9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:41:06
Further changes towards aouto creation of lbl files.
Prettified lbl files
check-in: 98cc4a6dc4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/abg2sympar_m2txt from [77f608f79b] to [8892b22156].

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
# 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 '







|

|





>
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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 | tr $SEPS $REPS |\
     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 '

Modified mttroot/mtt/bin/trans/m/alias_args.m from [75006dd80b] to [20a02d9fd1].

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
function args = alias_args(args,alias,delim,message,FileID,sys_name)

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




## Revision 1.5  2000/10/12 19:27:20  peterg
## Now writes out the aliased args ...
##
## Revision 1.4  2000/09/14 13:35:43  peterg
## appended '(' and ')' to SEPS
##   -- otherwise first argument after '(' doesn't get substituted
## (Fixed by Geraint)
##
## Revision 1.3  1998/08/11 14:09:05  peterg
## Replaced incorrect length(args>0) with !isempty(args)
##
## Revision 1.2  1998/07/27 10:24:20  peterg
## Included , in the the list of seperators (SEPS)
## This makes it substitute for bits of args separated by commas.
##
## Revision 1.1  1998/07/03 18:29:40  peterg
## Initial revision
##
###############################################################


  if is_struct(alias)
    if !isempty(args)
      Args = split(args,delim); args="";
      [N,M]= size(Args);
      for i=1:N
        arg = deblank(Args(i,:));
        arg_ = strrep(arg,",","__");
        if struct_contains(alias,arg_)
          eval(["new_arg = alias.", arg_,";"]);
  	  mtt_info(["Replacing ", arg, "\t by ",\
		    new_arg, message],FileID);
  	  mtt_save_alias(arg,sys_name);

          arg = new_arg;
	else
	  mtt_info(["NOT replacing ", arg, message],FileID);
        end
        SEPS = ",+-*/()";
        for j = 1:length(SEPS)
	  if length(findstr(arg,SEPS(j)))>0
	    arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name);
	  end 
	end;
        args = sprintf("%s%s%s", args, delim, arg);
      end


      args = substr(args,2); % loose leading ;



    end
  end;
endfunction;







>
>
>
>




















<














|
|

|

|





>
>
|
>
>
>



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
63
64
65
function args = alias_args(args,alias,delim,message,FileID,sys_name)

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.6  2001/04/23 16:23:30  gawthrop
## Now stips ; from bottlom level argument list - allows aliasing of
## parts of a,b,c (eg a,b by using a,b;c
##
## Revision 1.5  2000/10/12 19:27:20  peterg
## Now writes out the aliased args ...
##
## Revision 1.4  2000/09/14 13:35:43  peterg
## appended '(' and ')' to SEPS
##   -- otherwise first argument after '(' doesn't get substituted
## (Fixed by Geraint)
##
## Revision 1.3  1998/08/11 14:09:05  peterg
## Replaced incorrect length(args>0) with !isempty(args)
##
## Revision 1.2  1998/07/27 10:24:20  peterg
## Included , in the the list of seperators (SEPS)
## This makes it substitute for bits of args separated by commas.
##
## Revision 1.1  1998/07/03 18:29:40  peterg
## Initial revision
##
###############################################################


  if is_struct(alias)
    if !isempty(args)
      Args = split(args,delim); args="";
      [N,M]= size(Args);
      for i=1:N
        arg = deblank(Args(i,:));
        arg_ = strrep(arg,",","__");
        if struct_contains(alias,arg_)
          eval(["new_arg = alias.", arg_,";"]);
  	  mtt_info(["Replacing ", arg, "\t by ",\
		    new_arg, message],FileID);
  	  mtt_save_alias(arg,sys_name);

          arg = new_arg;
# 	else
# 	  mtt_info(["NOT replacing ", arg, message],FileID);
        end
        SEPS = ",+-*/()^";
        for j = 1:length(SEPS)
	  if (length(arg)>0)&&(length(findstr(arg,SEPS(j)))>0)
	    arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name);
	  end 
	end;
        args = sprintf("%s%s%s", args, delim, arg);
      end
      if (length(args)>1)
	if (substr(args,1,1)==delim)
	  args = substr(args,2); # loose leading delimiter
	endif
      endif
      
    end
  end;
endfunction;

Modified mttroot/mtt/bin/trans/mtt_strip_args from [28faa759a2] to [6eac46312c].

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
#! /bin/sh

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

# Bourne shell script: strip args
# Strips unwanted bits from a list of arguments
# Label file to symbolic parameters conversion
# Copyright (C) 2000 by Peter J. Gawthrop

## $Id$  ##
## $Log$



## Revision 1.3  2000/10/17 12:33:13  peterg
## Added mtt_mod to the zapped list
##
## Revision 1.2  2000/10/16 09:06:26  peterg
## Write out the system as a second columns as well
##
## Revision 1.1  2000/10/16 09:04:04  peterg
## Initial revision
## ##
# Inform user
#echo "Creating $1_sympar.txt"

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

# This is the main transformation using gawk
tr $SEPS $REPS | \
awk '
function exact_match(name1, name2) {
  return ((match(name1,name2)>0)&&(length(name1)==length(name2)))
}













>
>
>













|

|







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
#! /bin/sh

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

# Bourne shell script: strip args
# Strips unwanted bits from a list of arguments
# Label file to symbolic parameters conversion
# Copyright (C) 2000 by Peter J. Gawthrop

## $Id$  ##
## $Log$
## Revision 1.4  2001/05/08 15:18:10  gawthrop
## Added trig and hyperbolic functions to argument exclusion list
##
## Revision 1.3  2000/10/17 12:33:13  peterg
## Added mtt_mod to the zapped list
##
## Revision 1.2  2000/10/16 09:06:26  peterg
## Write out the system as a second columns as well
##
## Revision 1.1  2000/10/16 09:04:04  peterg
## Initial revision
## ##
# Inform user
#echo "Creating $1_sympar.txt"

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

# This is the main transformation using gawk
tr $SEPS $REPS | \
awk '
function exact_match(name1, name2) {
  return ((match(name1,name2)>0)&&(length(name1)==length(name2)))
}


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