comment_replace_codeFragment.xsl
Replaces a comment elmement by a code fragment.
- srcML element:
src:comment - advice type:
replace - codeModifier type:
codeFragment
Example
Base Code
int foo( int i ) /** Assert 0 */ return 200; }
Code Modifier
<codeModifier type="codeFragment">
<text>if( i == 0 ) {</text>
<text> printf("ASSERT ERROR!!");</text>
<text>}</text>
</codeModifier>Modified Code
int foo( int i )
if( i == 0 ) {
printf("ASSERT ERROR!!");
}
return 200;
}
Examples in AspectX Sample Library
- Entry
Examples in AspectX Test Suite
- ReplaceComment
CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH
Match Templates Summary
src:comment[ax:advice[@type='replace' and position() = 1]/ax:codeModifier[@type='codeFragment']] (mode: weaving) - source
Replaces a comment element with a code fragment
Match Templates Detail
src:comment[ax:advice[@type='replace' and position() = 1]/ax:codeModifier[@type='codeFragment']] (mode: weaving) - source
Replaces a comment element with a code fragment
If the comment element contains other advices, these must be handled first. This is
achieved by moving the replace advice to the end of the pending advices.