Overview
Comment:Evaluates standard CRs (mtt::$cr) after user-defined CRs ($cr).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 5db922b86f3442f219d37580c3b77398d4dc7902fddeccf295f5157acb17f9a9
User & Date: geraint@users.sourceforge.net on 2004-09-03 08:38:28
Other Links: branch diff | manifest | tags
Context
2004-09-07
18:22:53
Issues a more helpful error message than the cryptic Octave stuff
if there are unconnected ports.
check-in: 5b281f0ce4 user: geraint@users.sourceforge.net tags: origin/master, trunk
2004-09-03
08:38:28
Evaluates standard CRs (mtt::$cr) after user-defined CRs ($cr). check-in: 5db922b86f user: geraint@users.sourceforge.net tags: origin/master, trunk
08:36:57
Checks for the existence of .pm files in either the working directory
or the mtt subdirectory (copied from cr/perl/).
check-in: 980342cc25 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/cr/perl/apply_cr.pl from [1de0fc9f10] to [41a7e19374].

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    @expressions = ();
    @prefixes = ();

    substitute_subexpressions();
    display_subexpressions () if ($debug);
    
    for ($i = 0; $i <= $#expressions; $i++) {
	my $result = process_expression ();

	if ($result) {
	    $prefixes[$i] = "";
	    $expressions[$i] = "$result";
	}
    }
    
    display_subexpressions () if ($debug);
    reassemble_expression ();
    print STDOUT "$expression";
}








|
<
<
<
<
<







74
75
76
77
78
79
80
81





82
83
84
85
86
87
88
    @expressions = ();
    @prefixes = ();

    substitute_subexpressions();
    display_subexpressions () if ($debug);
    
    for ($i = 0; $i <= $#expressions; $i++) {
	process_expression ();





    }
    
    display_subexpressions () if ($debug);
    reassemble_expression ();
    print STDOUT "$expression";
}

132
133
134
135
136
137
138
139
140
141
142
143
144

145
146



147
148














149
150
151
152
153
154
155
	    }
	}
    }
    if ($cr eq '') {
	return;
    }

    # call cr(arg1,arg2,...)
    if (-e "$cr.pm") {
	no strict 'refs';		# allow symbolic references
	my $expr = $expressions[$i];
	eval "require $cr";
	$cr->import (@_[1 .. $#_]);    

	&$cr ($expr);
	use strict 'refs';



    }















}
#-------------------------------------------------------------------------------
sub display_subexpressions() {

    for ($i = 0; $i <= $#expressions; $i++) {
	my $prefix = " ";
	$prefix = $prefixes[$i] if ($prefixes[$i]); 







|

<



>
|

>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	    }
	}
    }
    if ($cr eq '') {
	return;
    }

    # call cr(arg1,arg2,...) User-defined CR in the model directory
    if (-e "$cr.pm") {

	my $expr = $expressions[$i];
	eval "require $cr";
	$cr->import (@_[1 .. $#_]);    
	no strict 'refs';		# allow symbolic references
	my $substitution = &$cr ($expr);
	use strict 'refs';
	if ($substitution) {
	    $prefixes[$i] = "";
	    $expressions[$i] = "$substitution";
	}
    }
    # call cr(arg1,arg2,...) Standard CR in the mtt namespace
    if (-e "mtt/$cr.pm") {
	my $expr = $expressions[$i];
	my $mttcr = "mtt::$cr";
	eval "require 'mtt/$cr.pm'";
	$mttcr->import (@_[1 .. $#_]);
	no strict 'refs';		# allow symbolic references
	my $substitution = &$cr ($expr);
	use strict 'refs';
	if ($substitution) {
	    $prefixes[$i] = "";
	    $expressions[$i] = "$substitution";
	}
    }
}
#-------------------------------------------------------------------------------
sub display_subexpressions() {

    for ($i = 0; $i <= $#expressions; $i++) {
	my $prefix = " ";
	$prefix = $prefixes[$i] if ($prefixes[$i]); 


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