function_begin_codeFragment.xsl

Weaving Rule that weaves a code fragment at the beginning of a function.

The only thing this rule does is copying the advices to the src:block element. The actual weaving is handled by block_begin_codeFragment.xsl

  • srcML element: src:function
  • advice type: begin
  • codeModifier type: codeFragment

Example

Base Code

int foo() {
  printf("Hello");
}

Code Modifier

<codeModifier type="codeFragment">
  <text>printf("Hello World")</text>
</codeModifier>

Modified Code

int foo() {
  printf("Hello World");
  printf("Hello");
}

Examples in AspectX Sample Library

Examples in AspectX Test Suite

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

Match Templates Summary

* (param: node-set advicesmode: weaving_function_begin_codeFragment) - source
Default copy template
src:block (param: node-set advicesmode: weaving_function_begin_codeFragment) - source
Template for the function block
Apply tempates with mode to all (excludig advice elements) child elements

Match Templates Detail

* (param: node-set advicesmode: weaving_function_begin_codeFragment) - source
Default copy template
Parameters:
node-set advices - Advices which should be copied to the src:block element.
src:block (param: node-set advicesmode: weaving_function_begin_codeFragment) - source
Template for the function block
Parameters:
node-set advices - Advices which should be copied to the src:block element.
Apply tempates with mode to all (excludig advice elements) child elements