Overview
Comment:Replaced all-at-once pattern match with an inner loop over each variable.
The /regexp/ method drops dependencies if they have been seen previously.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 54761aa61788a755f6deb398986f9c51ab77879e9b0dbbe21ea124fe551c5539
User & Date: geraint@users.sourceforge.net on 2004-08-29 01:45:07
Other Links: branch diff | manifest | tags
Context
2004-08-29
01:46:56
Added rules to create ode2odes for sorted system: sesx and sesy. check-in: 3f26038590 user: geraint@users.sourceforge.net tags: origin/master, trunk
01:45:07
Replaced all-at-once pattern match with an inner loop over each variable.
The /regexp/ method drops dependencies if they have been seen previously.
check-in: 54761aa617 user: geraint@users.sourceforge.net tags: origin/master, trunk
00:19:49
Defaults to noAlgebraicSolver. check-in: 01f85326bc user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/ese_r2make.pl from [5f60dc69f9] to [f976c5ad02].

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

114
115
116
117





118
119
120
121
122
123
124
91
92
93
94
95
96
97












98
99
100
101
102




103
104
105
106
107
108
109
110
111
112
113
114







-
-
-
-
-
-
-
-
-
-
-
-




+
-
-
-
-
+
+
+
+
+







    }
    
    close (ESE);
}
#-------------------------------------------------------------------------------
sub get_dependencies {

    # create pattern to match any left values
    my $pattern = "";
    foreach my $lvar (keys %expressions) {
	$pattern = "$pattern|$lvar";
    }
    # strip initial |
    $pattern =~ s!\|(.*)!/$1/!;	# var1|var2|var3
    print "$pattern\n" if $debug;

    # compile the pattern to improve speed
    my $regexp = qr/($pattern)/;

    # compare the pattern to each expression
    foreach my $lvar (keys %expressions) {
	$dependencies{$lvar} = "";
	$_ = $expressions{$lvar};
	for my $lvar2 (keys %expressions) {
	while (/$regexp/g) {
	    # a left value has been found in the expression
	    # add it to the dependencies for this lvar
	    $dependencies{$lvar} = "$dependencies{$lvar} $1";
	    if ($expressions{$lvar} =~ /$lvar2/) {
		# a left value has been found in the expression
		# add it to the dependencies for this lvar
		$dependencies{$lvar} = "$dependencies{$lvar} $lvar2";
	    }
	}
	print "$lvar:\t$dependencies{$lvar}\n" if $debug;
    }
}
#-------------------------------------------------------------------------------
sub write_make {
    


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