<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Mar 18, 2012, at 3:14 PM, Anna Zaks <<a href="mailto:ganna@apple.com">ganna@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; display: inline !important; float: none; ">I also like the idea of visitors adding to the list of interesting symbols. Further, you could have a bunch of generic visitors and allow the checkers to choose which (of the generic ones) to use. You can also have a default list which gets generated with each BugReport by default.</span><br style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; display: inline !important; float: none; ">Before you go down the road of changing the order, try to experiment with it (using the simplest solution) to see if there are any unknown issues that reordering might lead to in terms of desired output. For example, what happens if you have default and custom visitors generating a note for the same pair of nodes? The order might change the quality of output.<span class="Apple-converted-space"> </span></span></blockquote></div><br><div>Instead of changing the order, I propose the following (very simple) algorithm which makes the ordering irrelevant:</div><div><br></div><div><div>(1) When visiting the BugReporterVisitors for a given node, set a flag "hasModifiedSymbols" to false.</div><div><br></div><div>(2) Visit each BugReporterVisitor, collecting on the side all the PathDiagnosticEvents created for that node.  If any of the BugReporterVisitors modify the set of interesting symbols, throw away the generated PathDiagnosticEvents for that node and go back to (1).</div><div><br></div><div>(3) If the interesting symbols don't change (hasModifiedSymbols"== false), take the generated PathDiagnosticsEvents for that node and add it to PathPieces.</div><div><br></div><div>This at least defines away the problem of which visitors we visit first.  It is entirely possible that a custom visitor may add an interesting symbol that a general visitor will find important, and vis versa.</div><div><br></div><div>The only problem then is ordering the PathDiagnosticEvents generated at specific node.  This problem seems orthogonal to (and now decoupled from) the problem of actually generating the PathDiagnosticEvents in the first place.</div></div></body></html>