<
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="
AllMultiplelineCodeFragments">
<
description>
The behaviour of the <
code>
<text></
code>
element is tested.
The weaving rule <
code>
return_before_codeFragment</
code>
is used for tests.
It would be also possible <!---->
to demostrate other combinations -- in particular
on <
code>
constructor_begin_codeFragment</
code>
, <
code>
constructor_end_codeFragment</
code>
,
<
code>
function_begin_codeFragment</
code>
, and <
code>
function_end_codeFragment</
code>
.
<
p />
This aspect aslo tests how <
code>
text</
code>
elements of <
code>
codeModifier</
code>
element
are handled.
<
author>
O. Rohlik</
author>
</
description>
<
advice type="
before"
name="
multipleLineSingleText1">
<
description>
This advise checks multiple line codeFragment with single <text> elements.</
description>
<
pointcut type="
src:return" />
<
codeModifier type="
codeFragment">
<
text>
/* comments treated as general text - line 1 */
/* comments treated as general text - line 2 */
/* comments treated as general text - line 3 */</
text>
</
codeModifier>
</
advice>
<
advice type="
before"
name="
multipleLineMutlipleText2">
<
description>
This advise checks multiple line codeFragment with multiple <text> elements.</
description>
<
pointcut type="
src:return" />
<
codeModifier type="
codeFragment">
<
text>
/* comments treated as general text - line 1 */</
text>
<
text>
/* comments treated as general text - line 2 */</
text>
<
text>
/* comments treated as general text - line 3 */</
text>
</
codeModifier>
</
advice>
<
advice type="
before"
name="
multipleLineIfSingleText3">
<
description>
This advise checks multiple line codeFragment with single <text> elements.</
description>
<
pointcut type="
src:return" />
<
codeModifier type="
codeFragment">
<
text>
int i = 0;
if (i==0) {
i = 1;
} else {
i = 0;
}</
text>
</
codeModifier>
</
advice>
<
advice type="
before"
name="
multipleLineIfSingleText4">
<
description>
This advise checks multiple line codeFragment with single <text> elements.</
description>
<
pointcut type="
src:return" />
<
codeModifier type="
codeFragment">
<
text>
int j = 0; /* if 'j' is replaced by 'i' it causes an error */</
text>
<
text>
if (i==0) {</
text>
<
text>
i = 1;</
text><!---->
<
text>
else</
text>
<
text>
i = 0;</
text>
</
codeModifier>
</
advice>
</
aspect>
v