<aspect xmlns:src="http://www.sdml.info/srcML/src" 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="AllFunctionDollarVariables">
  
<description>
      This aspect tests 
<code>all</code> dollar variables with exception of <code>blockBody</code> dollar 
      variable whis is tested in test suite for blocks.
      
<author>O. Rohlik</author>
  
</description> 
  
  
<advice type="add" name="classDollarVaribles">
      
<description>
          Test dollar variables defined for srcML element 
<code>class</code>.
      
</description>
      
<pointcut type="src:class" constraint="src:name='Derived'" />
      
<codeModifier type="declaration">
        
<accessModifier type="public" />
        
<text>/* This is codeFragment uses all dollar variables for CLASS */</text>
        
<text>/* 
className: ${className}
superClassNames: ${superClassNames}
*/
</text>
      
</codeModifier>
  
</advice>

  
  
<!-- this causes "replace() error -->
  
<!-- this is copied from the console
     [xslt] file:/D:/pnp/AspectXLib/functions/FunctionWeavingTests_AllFunctionDollarVariables/XWeaverTemp/locators/util.xsl:257: Fatal Error! A sequence of more than one item is not allowed as the first argument of replace()
     [xslt] Failed to process D:\pnp\AspectXLib\functions\FunctionWeavingTests_AllFunctionDollarVariables\XWeaverTemp\srcML\Base.h.xml
BUILD FAILED: D:\pnp\AspectXLib\functions\FunctionWeavingTests\build.xml:56: The following error occurred while executing this line:
D:\pnp\XWeaver\build.xml:91: Fatal error during transformation
  
-->
  
<advice type="add" name="function_declDollarVaribles">
      
<description>
          Test dollar variables defined for srcML element 
<code>function_decl</code>.
      
</description>
    
<pointcut type="src:function_decl" constraint="src:parameter_list/src:param" />
    
<codeModifier type="codeFragment">
        
<text>/* This is codeFragment uses all dollar variables in FUNCTION_DECL */</text>
        
<text>/* 
className: ${className}
functionName: ${functionName}
functionType: ${functionType}
paramNames[1]: ${paramNames[1]}
paramTypes[1]: ${paramTypes[1]}
*/
</text>
    
</codeModifier>
  
</advice>
  
    
  
<advice type="begin" name="functionDollarVaribles">
      
<description>
          Test dollar variables defined for srcML element 
<code>function</code>.
      
</description>
      
<pointcut type="src:function" constraint="src:parameter_list/src:param" />
      
<codeModifier type="codeFragment">
        
<text>/* This is codeFragment uses all dollar variables in FUNCTION */</text>
        
<text>/* 
className: ${className}
functionName: ${functionName}
functionType: ${functionType}
paramNames[1]: ${paramNames[1]}
paramTypes[1]: ${paramTypes[1]}
*/
</text>
      
</codeModifier>
  
</advice>
  
  
  
<advice type="before" name="returnDollarVaribles">
      
<description>
          Test dollar variables defined for srcML element 
<code>return</code>.
      
</description>
      
<pointcut type="src:return" /> <!--  constraint="src:parameter_list/src:param" -->
      
<codeModifier type="codeFragment">
        
<text>/* This is codeFragment uses all dollar variables for RETURN */</text>
        
<text>/* 
function: ${function}
className: ${className}
functionName: ${functionName}
functionType: ${functionType}
paramNames[1]: ${functionParamNames[1]}
paramTypes[1]: ${functionParamTypes[1]}
*/
</text>
      
</codeModifier>
  
</advice>

  
<advice type="add" name="unitDollarVaribles">
      
<description>
          Test dollar variables defined for srcML element 
<code>unit</code>.
      
</description>
      
<pointcut type="src:unit" />
      
<codeModifier type="definition">
        
<text>/* This is codeFragment uses all dollar variables for UNIT */</text>
        
<text>/* 
filename: ${filename}
className: ${className}
*/
</text>
      
</codeModifier>
  
</advice>
    
</aspect>






































v