Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 179393

Summary: factor IScanner.addDefinition(IMacro) into its own interface
Product: [Tools] CDT Reporter: Mike Kucera <mikekucera>
Component: cdt-coreAssignee: Chris Recoskie <recoskie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cdt-core-inbox, cdtdoug
Version: 4.0   
Target Milestone: 4.0 RC0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 173110    
Attachments:
Description Flags
proposed patch cdtdoug: iplog+

Description Mike Kucera CLA 2007-03-26 17:39:13 EDT
The createCodeReaderForInclusion() method in IndexBasedCodeReaderFactory takes a reference to IScanner as a parameter, but it only calls one method on it... addDefinition(IMacro). The new C99 parser needs to be able to work with IndexBasedCodeReaderFactory, however the C99 parser doesn't use the IScanner interface anywhere. I would like to factor out addDefinition(IMacro) into its own interface (which can then be made a superinterface of IScanner).
Comment 1 Mike Kucera CLA 2007-03-28 13:10:47 EDT
Created attachment 62252 [details]
proposed patch

Proposed patch.
Comment 2 Chris Recoskie CLA 2007-04-03 14:12:55 EDT
I would like to apply this.

I suggest a more descriptive name for the callback though.  ICodeReaderFactoryCallback doesn't really tell me what the thing is actually doing.  I would suggest calling the interface IMacroCollector instead.  Sound ok?
Comment 3 Anton Leherbauer CLA 2007-04-04 04:12:42 EDT
I have no objections. I would like to suggest that IScanner and the new base interface be declared "provisional" API to make it clear that clients take a risk in relying on it (http://wiki.eclipse.org/index.php/Provisional_API_Guidelines).
Actually, I think this is kind of an API for ISVs rather than public API. Eclipse has no standardized means to differentiate between those, though.
Comment 4 Chris Recoskie CLA 2007-04-04 11:51:17 EDT
FIXED on HEAD.  All suggested changes have been made.