<
aspect xmlns:src="
http://www.sdml.info/srcML/src"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns="
http://control.ee.ethz.ch/XWeaver/AspectX"
xsi:schemaLocation="
http://control.ee.ethz.ch/XWeaver/AspectX ../../../../src/xsd/aspectX.xsd"
name="
AllReturnBeforeCodeFragment">
<
description>
The weaving rule <
code>
return_before_codeFragment</
code>
is tested.
This advice also tests whether curly braces are inserted
where necessary.
<
author>
O. Rohlik</
author>
</
description>
<!---->
<!---->
<!---->
<
advice type="
before"
name="
allReturnStatements">
<
description>
The IF-THEN-ELSE statement is inserted before every occurence of
<
code>
return</
code>
.
</
description>
<
pointcut type="
src:return" />
<
codeModifier type="
codeFragment">
<
text>
/* This is codeFragment added by advice returnStatement to every function definitions that contains return statement */</
text>
<
text>
int i=0;
if (i==0) {
i = 1;
} else {
i = 0;
}</
text>
</
codeModifier>
</
advice>
</
aspect>
v