Further questions on Visitor

Hi Todd,

 Todd King - MSFT wrote:

Unfortunately the VisitTry and VisitCatch methods are never visited by our visitor in 1.35 (it wasn’t hooked up yet in that version). This problem will be fixed in the next release. In the meantime you are going to have to use the method’s instruction list to keep track of OpCode._Try and OpCode._EndTry to detect when you enter and leave a try block and use OpCode._Catch, OpCode._Finally, and OpCode._EndHandler to detect when you enter and leave a catch or finally block.  Or you can wait till 1.36 is released in which case the VistTry and VisitCatch approach will work.

 

 which Visitor are you refering to ("...our visitor in 1.35...")

I used FxCop to look at IL code of Method Microsoft.Cci.StandardVisitor.Visit(...). In the IL representation there are Virtual Calls to 53 Visit<...> methods, including VisitTry and VisitCatch. Is StandardVisitor the wrong class to look at At least it is referred by Visit(...) in Microsoft.FxCop.Sdk.Introspection.BaseIntrospectionRule which is the base class of my custom rules. As of now, it seems to me that all Visit<...> methods are active and should be called. Or am I missing out on something

 Further questions I always wanted to ask ;-)

- Which C# entities are subsumed under "construct" and "identifier"

- Can TernaryExpression be something else than the " -:" operator

- When will you release the highly anticipated new versions of FxCop (1.36 2 )

 

Greetings, Klaus Lutterjohann

 



Answer this question

Further questions on Visitor

  • Gurpreet_Sodhi_69db48

    Although the VisitXXX methods are called by the visitor, the exception handling blocks are not raised by our binary reader in 1.35, as Todd stated, this is now hooked up and will be available in FxCop/Visual Studio.

    The Construct object represents a creation of a new object, such as 'new object()'

    The Identifier object represents the name of an object, ie a method's, type's, field's, etc name.

    We don't raise TernaryExpression (this remains from the days when the binary reader raised from source) and I'm not sure because I'm not at work at the moment, but I believe that this has been ripped in the latest builds.

    We won't be looking to release vNext of FxCop until probably the first quarter of next year.

    Regards

    David



  • Further questions on Visitor