<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Luxi Mono">
<p>On Wednesday 19 April 2006 23:10, Frans Englich wrote:</p>
<p><span style="color:#008000">> On Wednesday 19 April 2006 22:45, Alexander Neundorf wrote:</span></p>
<p>[...]</p>
<p><span style="color:#008000">> It would certainly be interesting. One could write the tests in XQuery or</span></p>
<p><span style="color:#008000">> XSL-T</span></p>
<p></p>
<p>An example:</p>
<p></p>
<p>C++ code:</p>
<p></p>
<p>------------------------------------------</p>
<p>class KFoo</p>
<p>{</p>
<p>        void SetMyProp(bool newValue);</p>
<p>};</p>
<p>------------------------------------------</p>
<p></p>
<p>gcc-xml output:</p>
<p></p>
<p>------------------------------------------</p>
<p><GCC_XML></p>
<p>  <Namespace id="_1" name="::" members="_3 " mangled="_Z2::"/></p>
<p>  <Namespace id="_2" name="std" context="_1" members="" mangled="_Z3std"/></p>
<p>  <Class id="_3" name="KFoo" context="_1" mangled="4KFoo" location="f0:2" file="f0" line="2" members="_4 _5 _6 " bases=""/></p>
<p>  <Constructor id="_4" name="KFoo" artificial="1" throw="" context="_3" mangled="_ZN4KFooC1ERKS_ *INTERNAL* " location="f0:2" file="f0" line="2"></p>
<p>    <Argument name="_ctor_arg" type="_7"/></p>
<p>  </Constructor></p>
<p>  <Constructor id="_5" name="KFoo" artificial="1" throw="" context="_3" mangled="_ZN4KFooC1Ev *INTERNAL* " location="f0:2" file="f0" line="2"/></p>
<p>  <Method id="_6" name="SetMyProp" returns="_8" access="private" context="_3" mangled="_ZN4KFoo9SetMyPropEb" location="f0:3" file="f0" line="3" extern="1"></p>
<p>    <Argument name="newValue" type="_9"/></p>
<p>  </Method></p>
<p>  <ReferenceType id="_7" type="_3c"/></p>
<p>  <FundamentalType id="_8" name="void"/></p>
<p>  <FundamentalType id="_9" name="bool"/></p>
<p>  <CvQualifiedType id="_3c" type="_3" const="1"/></p>
<p>  <File id="f0" name="t.cpp"/></p>
<p></GCC_XML></p>
<p>------------------------------------------</p>
<p></p>
<p></p>
<p>XQuery:</p>
<p></p>
<p>------------------------------------------</p>
<p>xquery version "1.0" encoding "UTF-8";</p>
<p>declare variable input := "outputs/gcc-xml-output.xml" as document();</p>
<p></p>
<p>(: Select every Method element that is a child of the Child element which in turn is child of GCC_XML, and which has an attribute by name 'name' and whose content starts with Set :)</p>
<p></p>
<p>(: We only want methods which has one argument. :)</p>
<p>for $i in $input/GCC_XML/Class/Method[starts-with(./@name, "Set") and count(./Argument) eq 1) return</p>
<p></p>
<p>        <error></p>
<p>                <file name="{//File[@id eq $i/@file]}"</p>
<p>                      line="{$i/@line}"/></p>
<p>                <description>The function {$i/@name} of class {../@name}</p>
<p>is a setter and should therefore not start with 'Set', but 'set.'</description></p>
<p>        </error></p>
<p>------------------------------------------</p>
<p></p>
<p></p>
<p>Produces:</p>
<p></p>
<p>------------------------------------------</p>
<p><error></p>
<p>       <file name="t.cpp" line="3"/></p>
<p>       <description>The function SetMyProp of class KFoo is a setter and </p>
<p>should therefore not start with 'Set', but 'set.'</description></p>
<p></error></p>
<p>------------------------------------------</p>
<p></p>
<p>And transform it to HTML, pipe it onto EBN, etc.</p>
<p></p>
<p>Right, this is not enough for eliminating false positives(and it's not tested). I'm merely demonstrating my point.</p>
<p></p>
<p></p>
<p>Cheers,</p>
<p></p>
<p>               Frans</p>
<p></p>
</body></html>