<
aspect xmlns:src="
http://www.sdml.info/srcML/src"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:cpp="
http://www.sdml.info/srcML/cpp"
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="
AddFunctionComment_1">
<
description>
Sample aspect program to modify a function comment. This aspect program defines a text
fragment that can be added to the comment of a target function. The target function is defined by name
and is equal to <
code>
split</
code>
. A related aspect program
(<
code>
AddFunctionComment_2</
code>
) shows an alternative way to modify class comments. <
author>
I. Birrer</
author>
<
see>
AddFunctionComment_2</
see>
</
description>
<
pointcut name="
targetFunction"
type="
src:function"
constraint="
src:name='split'">
<
description>
Points to the target function whose comment should be modified. </
description>
</
pointcut>
<
pointcut name="
targetFunctionComment"
type="
src:comment">
<
description>
Points to the comment that must be modified. This comment is defined as the comment
that is followed by the <
code>
targetFunction</
code>
pointcut. </
description>
<
restriction type="
followedBy">
<
pointcutRef type="
src:function"
ref="
targetFunction" />
</
restriction>
</
pointcut>
<
advice name="
addFunctionComment"
type="
end">
<
description>
Add a comment at the end of the comment of the target function. The HTML tags in the
comment are expressed using escape sequences. Aspect program <
code>
AddFunctionComment_2</
code>
shows an alternative way to express the HTML tag.</
description>
<
pointcutRef ref="
targetFunctionComment"
type="
src:comment" />
<
codeModifier type="
comment">
<
text>
This comment fragment was automatically inserted by an aspect program.</
text>
<
text>
The name of the aspect program is: <code>AddFunctionComment_1</code>.</
text>
</
codeModifier>
</
advice>
</
aspect>
v