declaration_add_comment.xsl
Weaving Rule that adds a comment to a declaration (class/method/constructor/destructor/fields)
- srcML element:
src:function_decl, src:function, src:class, src:constructor, src:constructor_decl, src:constructor, src:destructor, src:destructor_decl, src:decl_stmt - advice type:
add - codeModifier type:
comment
Example 1
int foo();
Code Modifier
<codeModifier type="comment">
<text>/** A comment */</text>
</codeModifier>Modified Code
/** A comment */ int foo();
Examples in AspectX Sample Library
- CleanupComments
CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH
Match Templates Summary
src:function_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:function[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:destructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:destructor_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:class[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:decl_stmt[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] (mode: weaving) - source
Adds the the comment before the declaration
Match Templates Detail
src:function_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:function[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:destructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:destructor_decl[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:class[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:constructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] | src:decl_stmt[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='comment']] (mode: weaving) - source
Adds the the comment before the declaration