1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-21 07:05:58 +02:00

Patch for Bogdan Gheorghe

In this patch: 

- Improved error handling for Indexer 
- Improved error handling for MatchLocator 
- Bounds checking for mappings in IncudeEntry 
- Improved error handling for Merge operations 
- Source file name fitering for recreating an already existing index
This commit is contained in:
John Camelon 2004-02-13 22:03:10 +00:00
parent a3fa47a00c
commit bb4821dee3
9 changed files with 373 additions and 327 deletions

View file

@ -1,16 +1,27 @@
2004-02-10 Bogdan Gheorghe 2004-02-13 Bogdan Gheorghe
PR 51232 PR 51232
- Added mapping range checking to IncludeEntry to avoid out of bounds exceptions
- Added error handling to MergeFactory to handle problems during the save operation
- Added source file name filtering for the recreate an already existing index scenario in
IndexAllProject.
- Added more robust error handling to SourceIndexer
- Added error handling routine to Util.getFileCharContent() to deal with potential out of
memory crash
* index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java
* index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java
* index/org/eclipse/cdt/internal/core/index/search/Util.java
* index/org/eclipse/cdt/internal/core/index/search/indexing/IndexAllProject.java
* index/org/eclipse/cdt/internal/core/index/search/indexing/SourceIndexer.java
* index/org/eclipse/cdt/internal/core/index/search/indexing/AddFolderToIndex.java
2004-02-10 Bogdan Gheorghe
- Added a layer of separation between the parser and the indexer: we now
create a worker thread to run the parser in. This allows the indexer to
finish all scheduled jobs regardless of how the parser performs on
individual files (i.e. indexing no longer affected by parser failures)
- Modified some of the stored index block reading routines to use separate - Modified some of the stored index block reading routines to use separate
counters, thus avoiding potential EOF exceptions. counters, thus avoiding potential EOF exceptions.
* index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java * index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java
* index/org/eclipse/cdt/internal/core/index/search/indexing/SourceIndexer.java
2004-02-03 Alain Magloire 2004-02-03 Alain Magloire

View file

@ -148,7 +148,11 @@ public class Util {
try { try {
stream = new BufferedInputStream(new FileInputStream(file)); stream = new BufferedInputStream(new FileInputStream(file));
return Util.getInputStreamAsCharArray(stream, (int) file.length(), encoding); return Util.getInputStreamAsCharArray(stream, (int) file.length(), encoding);
} finally { }
catch (OutOfMemoryError er){
return null;
}
finally {
if (stream != null) { if (stream != null) {
try { try {
stream.close(); stream.close();

View file

@ -157,8 +157,12 @@ public class IncludeEntry {
*/ */
public void mapRefs(int[] mappings) { public void mapRefs(int[] mappings) {
int position= 0; int position= 0;
for (int i= 0; i < fNumRefs; i++) { for (int i= 0; i < fNumRefs; i++) {
int map= mappings[fRefs[i]]; //Take care that the reference is actually within the bounds of the mapping
int map= -1;
if(fRefs[i] >= 0 && fRefs[i] < mappings.length)
map= mappings[fRefs[i]];
if (map != -1 && map != 0) if (map != -1 && map != 0)
fRefs[position++]= map; fRefs[position++]= map;
} }

View file

@ -13,6 +13,9 @@ package org.eclipse.cdt.internal.core.index.impl;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.cdt.internal.core.search.processing.JobManager;
/** /**
* A mergeFactory is used to merge 2 indexes into one. One of the indexes * A mergeFactory is used to merge 2 indexes into one. One of the indexes
* (oldIndex) is on the disk and the other(addsIndex) is in memory. * (oldIndex) is on the disk and the other(addsIndex) is in memory.
@ -81,7 +84,24 @@ public class MergeFactory {
mergeReferences(); mergeReferences();
mergeIncludes(); mergeIncludes();
mergeOutput.flush(); mergeOutput.flush();
} finally { }
catch ( Exception ex ){
if (ex instanceof IOException)
throw (IOException) ex;
else {
if (IndexManager.VERBOSE) {
JobManager.verbose("-> got the following exception during merge:"); //$NON-NLS-1$
ex.printStackTrace();
}
}
}
catch ( VirtualMachineError er ) {
if (IndexManager.VERBOSE) {
JobManager.verbose("-> got the following exception during merge:"); //$NON-NLS-1$
er.printStackTrace();
}
}
finally {
//closes everything //closes everything
oldInput.close(); oldInput.close();
addsInput.close(); addsInput.close();

View file

@ -58,13 +58,12 @@ class AddFolderToIndex extends IndexRequest {
public boolean visit(IResourceProxy proxy) throws CoreException { public boolean visit(IResourceProxy proxy) throws CoreException {
switch(proxy.getType()) { switch(proxy.getType()) {
case IResource.FILE : case IResource.FILE :
// TODO: BOG Put the file name checking back if (Util.isCCFileName(proxy.getName())) {
//if (Util.isJavaFileName(proxy.getName())) {
IResource resource = proxy.requestResource(); IResource resource = proxy.requestResource();
if (pattern == null || !Util.isExcluded(resource, pattern)) if (pattern == null || !Util.isExcluded(resource, pattern))
indexManager.addSource((IFile)resource, container); indexManager.addSource((IFile)resource, container);
//} }
//return false; return false;
case IResource.FOLDER : case IResource.FOLDER :
if (pattern != null && Util.isExcluded(proxy.requestResource(), pattern)) if (pattern != null && Util.isExcluded(proxy.requestResource(), pattern))
return false; return false;

View file

@ -124,9 +124,8 @@ public class IndexAllProject extends IndexRequest {
public boolean visit(IResourceProxy proxy) { public boolean visit(IResourceProxy proxy) {
if (isCancelled) return false; if (isCancelled) return false;
switch(proxy.getType()) { switch(proxy.getType()) {
case IResource.FILE : case IResource.FILE :
// TODO: BOG Put the file name checking back if (Util.isCCFileName(proxy.getName())) {
//if (Util.isCCFileName(proxy.getName())) {
IResource resource = proxy.requestResource(); IResource resource = proxy.requestResource();
IPath path = resource.getLocation(); IPath path = resource.getLocation();
if (path != null && (patterns == null || !Util.isExcluded(resource, patterns))) { if (path != null && (patterns == null || !Util.isExcluded(resource, patterns))) {
@ -136,8 +135,8 @@ public class IndexAllProject extends IndexRequest {
? (Object) resource ? (Object) resource
: (Object) OK); : (Object) OK);
} }
//} }
//return false; return false;
case IResource.FOLDER : case IResource.FOLDER :
if (patterns != null && Util.isExcluded(proxy.requestResource(), patterns)) if (patterns != null && Util.isExcluded(proxy.requestResource(), patterns))
return false; return false;

View file

@ -88,28 +88,39 @@ public class SourceIndexer extends AbstractIndexer {
ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, requestor ), ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, requestor ),
requestor, ParserMode.COMPLETE_PARSE, language ); requestor, ParserMode.COMPLETE_PARSE, language );
ParserRunner p = new ParserRunner(parser);
Thread t = new Thread(p, "CDT Indexer Parser Runner");
t.start();
try{ try{
t.join(); boolean retVal = parser.parse();
}
catch (InterruptedException e){
org.eclipse.cdt.internal.core.model.Util.log(null, "Parser Runner InterruptedException - file: " + resourceFile.getFullPath(), ICLogConstants.CDT);
}
boolean retVal = p.getResult();
if (!retVal)
org.eclipse.cdt.internal.core.model.Util.log(null, "Failed to index " + resourceFile.getFullPath(), ICLogConstants.CDT);
if (AbstractIndexer.VERBOSE){
if (!retVal) if (!retVal)
AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString()); org.eclipse.cdt.internal.core.model.Util.log(null, "Failed to index " + resourceFile.getFullPath(), ICLogConstants.CDT);
else
AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString()); if (AbstractIndexer.VERBOSE){
} if (!retVal)
AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString());
else
AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString());
}
}
catch ( VirtualMachineError vmErr){
if (vmErr instanceof OutOfMemoryError){
org.eclipse.cdt.internal.core.model.Util.log(null, "Out Of Memory error: " + vmErr.getMessage() + " on File: " + resourceFile.getName(), ICLogConstants.CDT);
}
}
catch ( Exception ex ){
if (ex instanceof IOException)
throw (IOException) ex;
}
finally{
//Release all resources
parser=null;
currentProject = null;
requestor = null;
provider = null;
scanInfo=null;
}
} }
/** /**
* Sets the document types the <code>IIndexer</code> handles. * Sets the document types the <code>IIndexer</code> handles.
@ -122,25 +133,4 @@ public class SourceIndexer extends AbstractIndexer {
return resourceFile; return resourceFile;
} }
class ParserRunner implements Runnable {
IParser parser;
boolean retVal;
ParserRunner(IParser parser){
this.parser = parser;
}
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run() {
try{
retVal=parser.parse();
}
catch (Exception e){
org.eclipse.cdt.internal.core.model.Util.log(null, "Parser Runner Exception " + resourceFile.getFullPath() + " Message: " + e.getMessage(), ICLogConstants.CDT);
}
}
boolean getResult(){ return retVal;}
}
} }

View file

@ -1,266 +1,270 @@
2004-02-05 Alain Magloire 2004-02-13 Bogdan Gheorghe
PR 51221 - Added error handling to MatchLocator.locateMatches to handle possible
Reformat Patch from Bogdan base on Thomas Fletcher original patch parser failures.
In a nutshell, it moves the search operation into a runnable which
can be passed to a progress dialog. 2004-02-05 Alain Magloire
PR 51221
* search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java Reformat Patch from Bogdan base on Thomas Fletcher original patch
In a nutshell, it moves the search operation into a runnable which
2003-10-23 Bogdan Gheorghe can be passed to a progress dialog.
- Added AcceptMatchOperation to get around Bug 45324. The search * search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java
operation is no longer a WorkspaceModifyOperation (which used to
lock the workspace for the duration of search). Instead, we now 2003-10-23 Bogdan Gheorghe
lock the workspace only when we tag the resources with markers.
- Added AcceptMatchOperation to get around Bug 45324. The search
- Modified SearchEngine : we now receive a list of matches operation is no longer a WorkspaceModifyOperation (which used to
from the search that we pass into the AcceptMatchOperation. lock the workspace for the duration of search). Instead, we now
lock the workspace only when we tag the resources with markers.
- Modified MatchLocator to add matches to passed in list instead
of reporting them right away - Modified SearchEngine : we now receive a list of matches
from the search that we pass into the AcceptMatchOperation.
- Modified JobManager: -added in jobToIgnore parm to unblock dependency
jobs - Modified MatchLocator to add matches to passed in list instead
of reporting them right away
2003-10-06 Bogdan Gheorghe - Modified JobManager: -added in jobToIgnore parm to unblock dependency
- added createCFileSearchScope() to SearchEngine.java to improve jobs
code complete performance
2003-10-01 Andrew Niefer 2003-10-06 Bogdan Gheorghe
- fix bug 44026 by checking scope before reporting match in MatchLocator.report - added createCFileSearchScope() to SearchEngine.java to improve
code complete performance
2003-10-01 Andrew Niefer
- fix BasicSearchMatch.equals() for bug43988 2003-10-01 Andrew Niefer
- fix bug 44026 by checking scope before reporting match in MatchLocator.report
2003-09-30 Bogdan Gheorghe
- changed logging in JobManager to use new ICLogConstants 2003-10-01 Andrew Niefer
- fix BasicSearchMatch.equals() for bug43988
2003-09-30 Andrew Niefer
-fix bug43862 - Cannot find macro delcarations using all occurences. 2003-09-30 Bogdan Gheorghe
* modified CSearchPattern.createMacroPattern - changed logging in JobManager to use new ICLogConstants
2003-09-29 Andrew Niefer 2003-09-30 Andrew Niefer
- fix bug 43062 outline is confused on operator methods containing spaces -fix bug43862 - Cannot find macro delcarations using all occurences.
- modify CSearchPattern.scanForNames to use same naming convention as TokenDuple.toString() * modified CSearchPattern.createMacroPattern
- modify MatchLocator.report to use IASTOffsetableNamedElement.getNameEndOffset()
2003-09-29 Andrew Niefer
2003-09-29 Andrew Niefer - fix bug 43062 outline is confused on operator methods containing spaces
-bug42911 - Search: cannot find beyond use of data member - modify CSearchPattern.scanForNames to use same naming convention as TokenDuple.toString()
- fix NPE's in BasicSearchMatch.equals & hashCode - modify MatchLocator.report to use IASTOffsetableNamedElement.getNameEndOffset()
2003-09-29 Andrew Niefer 2003-09-29 Andrew Niefer
-fix NPE if IScannerInfoProvider returns null IScannerInfo -bug42911 - Search: cannot find beyond use of data member
- fix NPE's in BasicSearchMatch.equals & hashCode
2003-09-25 Andrew Niefer
- bug43129 - Cannot search for definitions of global variables 2003-09-29 Andrew Niefer
- check definitions for variables, fields, enumerators and namespaces -fix NPE if IScannerInfoProvider returns null IScannerInfo
- handle enter/exitLinkageSpecification
* search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java 2003-09-25 Andrew Niefer
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java - bug43129 - Cannot search for definitions of global variables
- check definitions for variables, fields, enumerators and namespaces
2003-09-25 Bogdan Gheorghe - handle enter/exitLinkageSpecification
- added SearchFor INCLUDE in ICSearchConstants * search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
- added acceptIncludeDeclaration to IIndexSearchRequestor * search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
- modified PathCollector to acceptIncludeDeclarations
- modified CSearchPattern to create an IncludePattern 2003-09-25 Bogdan Gheorghe
- added IncludePattern.java - added SearchFor INCLUDE in ICSearchConstants
- added acceptIncludeDeclaration to IIndexSearchRequestor
2003-09-25 Andrew Niefer - modified PathCollector to acceptIncludeDeclarations
- partial fix for 43664 Modify Matchlocator to not try and create a link if we have no - modified CSearchPattern to create an IncludePattern
resource, instead just use the path - added IncludePattern.java
2003-09-23 Andrew Niefer 2003-09-25 Andrew Niefer
fix bug 43498 Search with ? fails on first letter of second word - partial fix for 43664 Modify Matchlocator to not try and create a link if we have no
-modifications to CSearchPattern.scanForNames() resource, instead just use the path
-add getSimpleName to MethodDeclarationPattern
2003-09-23 Andrew Niefer
2003-09-19 Andrew Niefer fix bug 43498 Search with ? fails on first letter of second word
fix bug 43327 Code Complete finds local variables -modifications to CSearchPattern.scanForNames()
- modified MatchLocator to not report local declarations when boolean is set -add getSimpleName to MethodDeclarationPattern
- modified SearchEngine.search to take an additional parameter "excludeLocalDeclarations"
2003-09-19 Andrew Niefer
2003-09-15 Andrew Niefer fix bug 43327 Code Complete finds local variables
- modify CSearchPattern to handle escaping wildcards (bug43063) - modified MatchLocator to not report local declarations when boolean is set
- modify enterFunctionBody and enterMethodBody to fix bug42979 - modified SearchEngine.search to take an additional parameter "excludeLocalDeclarations"
- search for Parameter References
2003-09-15 Andrew Niefer
2003-09-13 Andrew Niefer - modify CSearchPattern to handle escaping wildcards (bug43063)
-Searching for Typedefs: (bug42902) - modify enterFunctionBody and enterMethodBody to fix bug42979
- modified setElementInfo in BasicSearchResultCollector - search for Parameter References
- added TYPEDEF to ICSearchConstants
- modified CSearchPattern & ClassDeclarationPattern 2003-09-13 Andrew Niefer
- implemented acceptTypedef* in MatchLocator -Searching for Typedefs: (bug42902)
- modified BasicSearchMatch to implement Comparable - modified setElementInfo in BasicSearchResultCollector
- added TYPEDEF to ICSearchConstants
2003-09-11 Andrew Niefer - modified CSearchPattern & ClassDeclarationPattern
- Modified ICSearchResultCollector.createMatch to not take a parent parameter - implemented acceptTypedef* in MatchLocator
- modified BasicSearchResultCollector to create the parent string from the fully qualified name of the node - modified BasicSearchMatch to implement Comparable
- modified MatchLocator to keep track of most recent declaration for reporting purposes
- modified MatchLocator.report to use the most recent declaration 2003-09-11 Andrew Niefer
- Modified ICSearchResultCollector.createMatch to not take a parent parameter
2003-09-09 Andrew Niefer - modified BasicSearchResultCollector to create the parent string from the fully qualified name of the node
pattern matching on function parameters: - modified MatchLocator to keep track of most recent declaration for reporting purposes
- modified scanForParameters in CSearchPattern - modified MatchLocator.report to use the most recent declaration
- added getParamString in CSearchPattern
- modified matchLevel in MethodDeclarationPattern 2003-09-09 Andrew Niefer
pattern matching on function parameters:
Enumeration references - modified scanForParameters in CSearchPattern
- modified acceptEnumeratorReference in MatchLocator - added getParamString in CSearchPattern
- modified matchLevel in MethodDeclarationPattern
2003-09-05 Andrew Niefer
- fix searching for enumerators Enumeration references
- modified acceptEnumeratorReference in MatchLocator
2003-09-03 Andrew Niefer
- added CLASS_STRUCT to the SearchFor constants 2003-09-05 Andrew Niefer
- Modified CSearchPattern to handle CLASS_STRUCT - fix searching for enumerators
2003-08-26 Bogdan Gheorghe 2003-09-03 Andrew Niefer
- Added debug tracing statements to SearchEngine - added CLASS_STRUCT to the SearchFor constants
- Modified scanForNames in CSearchPattern to treat append - Modified CSearchPattern to handle CLASS_STRUCT
a token after "~" to allow for destructors search
- Added scope checking to MatchLocator 2003-08-26 Bogdan Gheorghe
- Added debug trace statements to MatchLocator - Added debug tracing statements to SearchEngine
- Modified scanForNames in CSearchPattern to treat append
2003-08-20 Bogdan Gheorghe a token after "~" to allow for destructors search
- Changed matching and reporting functions to handle nodes - Added scope checking to MatchLocator
of type IElaboratedTypeSpecifier - Added debug trace statements to MatchLocator
2003-08-12 Bogdan Gheorghe 2003-08-20 Bogdan Gheorghe
- Rolled field and variable search patterns into one pattern, in - Changed matching and reporting functions to handle nodes
order to allow for qualified var searches of type IElaboratedTypeSpecifier
2003-08-11 Andrew Niefer 2003-08-12 Bogdan Gheorghe
- Added Macro ICSearchConstant - Rolled field and variable search patterns into one pattern, in
- Added acceptMacro to IIndexSearchRequestor and PathCollector order to allow for qualified var searches
- Added MacroDeclaration Pattern
- Rolled method and function patterns into one method pattern 2003-08-11 Andrew Niefer
- Added WorkingCopy support to search - Added Macro ICSearchConstant
- Added acceptMacro to IIndexSearchRequestor and PathCollector
2003-08-08 Bogdan Gheorghe - Added MacroDeclaration Pattern
- Added CreateSearchScope to create a search scope out of - Rolled method and function patterns into one method pattern
CElements - Added WorkingCopy support to search
- Filled out CSearchScope to enable:
- adding a project to scope, include referenced projects 2003-08-08 Bogdan Gheorghe
- adding individual CElements to scope - Added CreateSearchScope to create a search scope out of
CElements
2003-08-08 Andrew Niefer - Filled out CSearchScope to enable:
- add function parameter information to search results - adding a project to scope, include referenced projects
- adding individual CElements to scope
2003-08-06 Andrew Niefer
- Create OrPattern which matches for search if any of its constituent patterns matches 2003-08-08 Andrew Niefer
- modified MatchLocator to support the OrPattern - add function parameter information to search results
- searching for All occurences now uses the OrPattern
2003-08-06 Andrew Niefer
2003-08-01 Andrew Niefer - Create OrPattern which matches for search if any of its constituent patterns matches
- Modified BasicSearchResultCollector to only accept matches it has not already seen - modified MatchLocator to support the OrPattern
- fixed bug in finding a resource when entering includes - searching for All occurences now uses the OrPattern
2003-07-29 Andrew Niefer 2003-08-01 Andrew Niefer
Refactoring Search result collection: - Modified BasicSearchResultCollector to only accept matches it has not already seen
- Modified ICSearchResultCollector - fixed bug in finding a resource when entering includes
- Modified IMatch
- Modified MatchLocator to reflect changes in ICSearchResultCollector 2003-07-29 Andrew Niefer
- Created BasicSearchMatch implements IMatch Refactoring Search result collection:
- Created BasicSearchResultCollector implements ICSearchResultCollector - Modified ICSearchResultCollector
- Modified IMatch
2003-07-28 Andrew Niefer - Modified MatchLocator to reflect changes in ICSearchResultCollector
- added abstract CSearchPattern.resetIndexInfo fix bug with searching with globally - Created BasicSearchMatch implements IMatch
qualified names - Created BasicSearchResultCollector implements ICSearchResultCollector
- fixed bug in CSearchPattern.matchQualifications to do with globally qualified names
- fixed bug in CSearchPattern.createFunctionPattern to do with parameter lists. 2003-07-28 Andrew Niefer
- added abstract CSearchPattern.resetIndexInfo fix bug with searching with globally
2003-07-25 Bogdan Gheorghe qualified names
- Added refs to PathCollector - fixed bug in CSearchPattern.matchQualifications to do with globally qualified names
- Filled in feedIndexRequestor for the new search patterns - fixed bug in CSearchPattern.createFunctionPattern to do with parameter lists.
- Fixed the FunctionDeclarationPattern to work with no parms
2003-07-25 Bogdan Gheorghe
2003-07-24 Andrew Niefer - Added refs to PathCollector
- Implemented decodeIndexEntry & matchIndexEntry for all patterns - Filled in feedIndexRequestor for the new search patterns
- changed MatchLocator to use a COMPLETE_PARSE. - Fixed the FunctionDeclarationPattern to work with no parms
2003-07-23 Andrew Niefer 2003-07-24 Andrew Niefer
-Changed ICSearchPattern.matchLevel to take a ISourceElementCallbackDelegate - Implemented decodeIndexEntry & matchIndexEntry for all patterns
-Changed ICSearchResultCollector.createMatch to take a ISourceElementCallbackDelegate - changed MatchLocator to use a COMPLETE_PARSE.
-first implementations of:
-CSearchPattern.createFunctionPattern 2003-07-23 Andrew Niefer
-CSearchPattern.createVariablePattern -Changed ICSearchPattern.matchLevel to take a ISourceElementCallbackDelegate
-CSearchPattern.createMethodPattern -Changed ICSearchResultCollector.createMatch to take a ISourceElementCallbackDelegate
-preliminary matching for remaining patterns -first implementations of:
-handling of remaining parser callbacks -CSearchPattern.createFunctionPattern
-generating index Prefixes for the patterns -CSearchPattern.createVariablePattern
-CSearchPattern.createMethodPattern
2003-07-14 Andrew Niefer -preliminary matching for remaining patterns
-Modified SearchFor instances in ICSearchConstants to more closely match what we are searching for -handling of remaining parser callbacks
-added IMatch interface, it represents matches found by the search engine, implementors can store -generating index Prefixes for the patterns
whatever information they like, see ICSearchResultCollector::createMatch
-added createMatch to the ICSearchResultCollector interface, the result collector is responsible for 2003-07-14 Andrew Niefer
implementing IMatch to store whatever data they want out of the AST nodes. -Modified SearchFor instances in ICSearchConstants to more closely match what we are searching for
-added skeleton patterns: -added IMatch interface, it represents matches found by the search engine, implementors can store
search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java whatever information they like, see ICSearchResultCollector::createMatch
search/org/eclipse/cdt/internal/core/search/matching/FunctionDeclarationPattern.java -added createMatch to the ICSearchResultCollector interface, the result collector is responsible for
search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java implementing IMatch to store whatever data they want out of the AST nodes.
search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java -added skeleton patterns:
search/org/eclipse/cdt/internal/core/search/matching/VariableDeclarationPattern.java search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java
-added beginnings of CSearchPattern::create*Pattern functions search/org/eclipse/cdt/internal/core/search/matching/FunctionDeclarationPattern.java
-modifications to MatchLocator to keep track of current scope search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java
-added CSearchPattern::matchQualifications search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/VariableDeclarationPattern.java
2003-07-10 Bogdan Gheorghe -added beginnings of CSearchPattern::create*Pattern functions
Provided implementation for ICSearchScope.java, CSearchScope.java -modifications to MatchLocator to keep track of current scope
-added CSearchPattern::matchQualifications
Hooked up new CWorkspaceScope, PathCollector, PatternSearchJob in SearchEngine.java
2003-07-10 Bogdan Gheorghe
Provided implementation for PatternSearchJob.java - PatternSearchJob is where the first part Provided implementation for ICSearchScope.java, CSearchScope.java
of the search occurs - using an IndexSelector to filter the indexes, it gets the indexes from
the IndexManager and then uses the passed in pattern to find the index matched. Once it finds Hooked up new CWorkspaceScope, PathCollector, PatternSearchJob in SearchEngine.java
an index match it adds the file path to the PathCollector.
Provided implementation for PatternSearchJob.java - PatternSearchJob is where the first part
Modified CSearchPattern - added support to find index entries. of the search occurs - using an IndexSelector to filter the indexes, it gets the indexes from
the IndexManager and then uses the passed in pattern to find the index matched. Once it finds
Modified ClassDeclarationPattern - added support to decode, match and report an index match it adds the file path to the PathCollector.
index entries.
Modified CSearchPattern - added support to find index entries.
Added: Modified ClassDeclarationPattern - added support to decode, match and report
* search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java index entries.
* search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java
* search/org/eclipse/cdt/internal/core/search/IndexSelector.java
* search/org/eclipse/cdt/internal/core/search/PathCollector.java Added:
* search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java
Modified: * search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java
* search/org/eclipse/cdt/core/search/ICSearchScope.java * search/org/eclipse/cdt/internal/core/search/IndexSelector.java
* search/org/eclipse/cdt/core/search/SearchEngine.java * search/org/eclipse/cdt/internal/core/search/PathCollector.java
* search/org/eclipse/cdt/internal/core/search/CSearchScope.java
* search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java Modified:
* search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java * search/org/eclipse/cdt/core/search/ICSearchScope.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java * search/org/eclipse/cdt/core/search/SearchEngine.java
* search/org/eclipse/cdt/internal/core/search/CSearchScope.java
2003-07-04 Andrew Niefer * search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java
Modified ICSearchConstants to use new nested classes SearchFor and LimitTo instead of int * search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java
for stronger type safety * search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
Updated MatchLocator to invoke parser to do actual search. 2003-07-04 Andrew Niefer
Modified ICSearchConstants to use new nested classes SearchFor and LimitTo instead of int
2003-06-27 Andrew Niefer for stronger type safety
Modified:
search/org.eclipse.cdt.core.search.matching/MatchLocator.java Updated MatchLocator to invoke parser to do actual search.
- enter/exitInclusion
- enterClassSpecifier 2003-06-27 Andrew Niefer
search/org.eclipse.cdt.core.search.matching/CSearchPattern.java Modified:
- createClassPattern search/org.eclipse.cdt.core.search.matching/MatchLocator.java
- matchesName - enter/exitInclusion
search/org.eclipse.cdt.core.search.matching/ClassDeclarationPattern.java - enterClassSpecifier
- matchLevel search/org.eclipse.cdt.core.search.matching/CSearchPattern.java
search/org.eclipse.cdt.core.search/ICSearchPattern.java - createClassPattern
search/org.eclipse.cdt.core.search/ICSearchResultCollector.java - matchesName
search/org.eclipse.cdt.core.search/SearchEngine.java search/org.eclipse.cdt.core.search.matching/ClassDeclarationPattern.java
- matchLevel
2003-06-25 Bogdan Gheorghe search/org.eclipse.cdt.core.search/ICSearchPattern.java
Modified: search/org.eclipse.cdt.core.search/ICSearchResultCollector.java
* search/org/eclipse/cdt/core/search/ICSearchConstants.java search/org.eclipse.cdt.core.search/SearchEngine.java
* search/org/eclipse/cdt/internal/core/search/Utils.java
- moved to index/org/eclipse/cdt/internal/core/search/Utils.java 2003-06-25 Bogdan Gheorghe
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java Modified:
* search/org/eclipse/cdt/internal/core/search/processing/IJob.java * search/org/eclipse/cdt/core/search/ICSearchConstants.java
* search/org/eclipse/cdt/internal/core/search/Utils.java
- moved to index/org/eclipse/cdt/internal/core/search/Utils.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
* search/org/eclipse/cdt/internal/core/search/processing/IJob.java
* search/org/eclipse/cdt/internal/core/search/processing/JobManager.java * search/org/eclipse/cdt/internal/core/search/processing/JobManager.java

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.internal.core.search.matching;
import java.io.CharArrayReader; import java.io.CharArrayReader;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.Reader; import java.io.Reader;
import java.util.ArrayList; import java.util.ArrayList;
@ -439,8 +440,22 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
if (VERBOSE) if (VERBOSE)
MatchLocator.verbose("*** New Search for path: " + pathString); MatchLocator.verbose("*** New Search for path: " + pathString);
parser.parse(); try{
parser.parse();
}
catch(Exception ex){
if (VERBOSE){
MatchLocator.verbose("MatchLocator Exception: ");
ex.printStackTrace();
}
}
catch(VirtualMachineError vmErr){
if (VERBOSE){
MatchLocator.verbose("MatchLocator VM Error: ");
vmErr.printStackTrace();
}
}
} }
} }