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

Examples in AspectX Test Suite

CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH

Match Templates Summary

Match Templates Detail

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.