<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 11, 2008, at 10:29 AM, Emerson Murphy-Hill wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Thanks Steve, this worked.  Although I had to use a slightly different endBuf, because the Lexer was complaining:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #aa0d91"></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #aa0d91">const</span> <span style="color: #aa0d91">char</span> *endBuf = SM-><span style="color: #2e0d6e">getBufferData</span>(LocStart.<span style="color: #2e0d6e">getFileID</span>()).<span style="color: #5c2699">second</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><br></div></div></div></blockquote>Be careful with this, this will explode violently if LocStart is a macro instantiation.  Before calling "getFileID()" generally you want to call "isMacroID()".  If you have a macro ID, you need to decide how your refactoring will handle it.  It seems pretty reasonable to just throw up your hands and say "can't do it", but you don't want to abort :)</div><div><br class="webkit-block-placeholder"></div><div>An example would be something like:</div><div><br class="webkit-block-placeholder"></div><div>#define X @interface foo</div><div><br class="webkit-block-placeholder"></div><div>X : bar { ...</div><div><br class="webkit-block-placeholder"></div><div>-Chris</div></body></html>