From 7c7ae6fd68c2505d7a6d327e23c638e02c7b045b Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Thu, 7 Apr 2005 20:33:22 +0000 Subject: [PATCH] Refactored IndexerOutput to allow for passing in the length of an offset. --- .../internal/core/index/IIndexerOutput.java | 4 +- .../index/cindexstorage/IndexerOutput.java | 8 +- .../ctagsindexer/CTagsConsoleParser.java | 2 +- .../index/ctagsindexer/CTagsFileReader.java | 2 +- .../index/sourceindexer/AbstractIndexer.java | 78 +++++++++---------- 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java index ed58f41c6d8..ad0b50fe864 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java @@ -19,8 +19,8 @@ import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry; public interface IIndexerOutput { public void addRef(int indexedFileNumber, char[] word); - public void addRef(int indexedFileNumber, char[] word, int offset, int offsetType); - public void addRef(int indexedFileNumber, String word, int offset, int offsetType); + public void addRef(int indexedFileNumber, char[] word, int offset, int offsetLength, int offsetType); + public void addRef(int indexedFileNumber, String word, int offset, int offsetLength, int offsetType); public IndexedFileEntry getIndexedFile(String path); public IndexedFileEntry addIndexedFile(String path); diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/cindexstorage/IndexerOutput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/cindexstorage/IndexerOutput.java index 601d8b4f432..f7787127afd 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/cindexstorage/IndexerOutput.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/cindexstorage/IndexerOutput.java @@ -30,13 +30,13 @@ public class IndexerOutput implements IIndexerOutput { * @deprecated */ public void addRef(int indexedFileNumber, char[] word){ - addRef(indexedFileNumber,word,1,1); + addRef(indexedFileNumber,word,1,1, 1); } /** * Adds a reference to the given word to the inMemoryIndex. */ - public void addRef(int indexedFileNumber, char[] word, int offset, int offsetType) { + public void addRef(int indexedFileNumber, char[] word, int offset, int offsetLength, int offsetType) { if (indexedFileNumber == 0) { throw new IllegalStateException(); } @@ -47,8 +47,8 @@ public class IndexerOutput implements IIndexerOutput { /** * Adds a reference to the given word to the inMemoryIndex. */ - public void addRef(int indexedFileNumber, String word, int offset, int offsetType) { - addRef(indexedFileNumber, word.toCharArray(), offset, offsetType); + public void addRef(int indexedFileNumber, String word, int offset, int offsetLength, int offsetType) { + addRef(indexedFileNumber, word.toCharArray(), offset, offsetLength, offsetType); } public void addRelatives(int indexedFileNumber, String inclusion, String parent) { diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsConsoleParser.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsConsoleParser.java index 60ba3ddf449..737988a675a 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsConsoleParser.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsConsoleParser.java @@ -117,7 +117,7 @@ public class CTagsConsoleParser implements IConsoleParser { String lineNumber = (String)tempTag.tagExtensionField.get(LINE); if (entryType != null) - indexer.getOutput().addRef(getFileNumber(),IndexEncoderUtil.encodeEntry(fullName,entryType,type), Integer.parseInt(lineNumber), ICIndexStorageConstants.LINE); + indexer.getOutput().addRef(getFileNumber(),IndexEncoderUtil.encodeEntry(fullName,entryType,type), Integer.parseInt(lineNumber), 1, ICIndexStorageConstants.LINE); } /** diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsFileReader.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsFileReader.java index fd814adcf41..b6a2ecd36a4 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsFileReader.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/ctagsindexer/CTagsFileReader.java @@ -129,7 +129,7 @@ public class CTagsFileReader { } if (entryType != null) - output.addRef(fileNum, IndexEncoderUtil.encodeEntry(fullName,entryType,type), lineNumber, ICIndexStorageConstants.LINE); + output.addRef(fileNum, IndexEncoderUtil.encodeEntry(fullName,entryType,type), lineNumber, 1, ICIndexStorageConstants.LINE); } /* (non-Javadoc) * @see org.eclipse.cdt.internal.core.index.IIndexer#index(org.eclipse.cdt.internal.core.index.IDocument, org.eclipse.cdt.internal.core.index.IIndexerOutput) diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/sourceindexer/AbstractIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/sourceindexer/AbstractIndexer.java index df5549d57fa..01ec2722306 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/sourceindexer/AbstractIndexer.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/sourceindexer/AbstractIndexer.java @@ -110,7 +110,7 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea IASTClassSpecifier baseClassSpec = (IASTClassSpecifier) typeSpec; char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS), baseClassSpec.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS), baseClassSpec.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } catch (ASTNotImplementedException e) {} } @@ -122,12 +122,12 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea if (decl instanceof IASTClassSpecifier){ IASTClassSpecifier friendClassSpec = (IASTClassSpecifier) decl; char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(), ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(), 1, ICIndexStorageConstants.OFFSET); } else if (decl instanceof IASTElaboratedTypeSpecifier){ IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl; char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS), friendClassSpec.getStartingOffset(), ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS), friendClassSpec.getStartingOffset(), 1, ICIndexStorageConstants.OFFSET); } else if (decl instanceof IASTFunction){ @@ -138,7 +138,7 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea } - this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),CLASS, ICSearchConstants.DECLARATIONS), classSpecification.getStartingOffset(), ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),CLASS, ICSearchConstants.DECLARATIONS), classSpecification.getStartingOffset(), 1, ICIndexStorageConstants.OFFSET); } else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT)) { @@ -151,7 +151,7 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea if (typeSpec instanceof IASTClassSpecifier){ IASTClassSpecifier baseClassSpec = (IASTClassSpecifier) typeSpec; char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS),baseClassSpec.getStartingOffset(), ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS),baseClassSpec.getStartingOffset(), 1, ICIndexStorageConstants.OFFSET); } } catch (ASTNotImplementedException e) {} } @@ -163,12 +163,12 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea if (decl instanceof IASTClassSpecifier){ IASTClassSpecifier friendClassSpec = (IASTClassSpecifier) decl; char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } else if (decl instanceof IASTElaboratedTypeSpecifier){ IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl; char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays(); - this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),friendClassSpec.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } else if (decl instanceof IASTFunction){ @@ -178,16 +178,16 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea } } - this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),STRUCT, ICSearchConstants.DECLARATIONS),classSpecification.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),STRUCT, ICSearchConstants.DECLARATIONS),classSpecification.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } else if (classSpecification.getClassKind().equals(ASTClassKind.UNION)) { - this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),UNION, ICSearchConstants.DECLARATIONS),classSpecification.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),UNION, ICSearchConstants.DECLARATIONS),classSpecification.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } public void addEnumerationSpecifier(IASTEnumerationSpecifier enumeration, int fileNumber) { - this.output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.DECLARATIONS),enumeration.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.DECLARATIONS),enumeration.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); Iterator i = enumeration.getEnumerators(); while (i.hasNext()) @@ -196,7 +196,7 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea char[][] enumeratorFullName = createEnumeratorFullyQualifiedName(en); - this.output.addRef(fileNumber, encodeEntry( enumeratorFullName, ENUMTOR_DECL, ENUMTOR_DECL_LENGTH ),en.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry( enumeratorFullName, ENUMTOR_DECL, ENUMTOR_DECL_LENGTH ),en.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } @@ -215,70 +215,70 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea } public void addEnumeratorReference(IASTEnumerator enumerator, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(createEnumeratorFullyQualifiedName(enumerator),ENUMTOR_REF,ENUMTOR_REF_LENGTH),enumerator.getStartingOffset(), ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(createEnumeratorFullyQualifiedName(enumerator),ENUMTOR_REF,ENUMTOR_REF_LENGTH),enumerator.getStartingOffset(), 1, ICIndexStorageConstants.OFFSET); } public void addMacro(IASTMacro macro, int fileNumber) { char[][] macroName = new char[][] { macro.getNameCharArray() }; - this.output.addRef(fileNumber, encodeEntry(macroName,MACRO_DECL,MACRO_DECL_LENGTH), macro.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(macroName,MACRO_DECL,MACRO_DECL_LENGTH), macro.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addEnumerationReference(IASTEnumerationSpecifier enumeration, int fileNumber) { - this.output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.REFERENCES), enumeration.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.REFERENCES), enumeration.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addVariable(IASTVariable variable, int fileNumber) { - this.output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.DECLARATIONS), variable.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.DECLARATIONS), variable.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addVariableReference(IASTVariable variable, int fileNumber) { - this.output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.REFERENCES),variable.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.REFERENCES),variable.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addParameterReference( IASTParameterDeclaration parameter, int fileNumber ){ - this.output.addRef(fileNumber,encodeTypeEntry( new char[][] { parameter.getNameCharArray() }, VAR, ICSearchConstants.REFERENCES), parameter.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeTypeEntry( new char[][] { parameter.getNameCharArray() }, VAR, ICSearchConstants.REFERENCES), parameter.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addTypedefDeclaration(IASTTypedefDeclaration typedef, int fileNumber) { - this.output.addRef(fileNumber,encodeEntry(typedef.getFullyQualifiedNameCharArrays(), TYPEDEF_DECL, TYPEDEF_DECL_LENGTH),typedef.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeEntry(typedef.getFullyQualifiedNameCharArrays(), TYPEDEF_DECL, TYPEDEF_DECL_LENGTH),typedef.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addFieldDeclaration(IASTField field, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_DECL,FIELD_DECL_LENGTH),field.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_DECL,FIELD_DECL_LENGTH),field.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addFieldReference(IASTField field, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_REF,FIELD_REF_LENGTH),field.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_REF,FIELD_REF_LENGTH),field.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addMethodDeclaration(IASTMethod method, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_DECL,METHOD_DECL_LENGTH),method.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_DECL,METHOD_DECL_LENGTH),method.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); Iterator i=method.getParameters(); while (i.hasNext()){ Object parm = i.next(); if (parm instanceof IASTParameterDeclaration){ IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm; - this.output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),parmDecl.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),parmDecl.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } } public void addMethodReference(IASTMethod method, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_REF,METHOD_REF_LENGTH),method.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_REF,METHOD_REF_LENGTH),method.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addElaboratedForwardDeclaration(IASTElaboratedTypeSpecifier elaboratedType, int fileNumber) { if (elaboratedType.getClassKind().equals(ASTClassKind.CLASS)) { - this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_CLASS, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_CLASS, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } else if (elaboratedType.getClassKind().equals(ASTClassKind.STRUCT)) { - this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_STRUCT, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_STRUCT, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } else if (elaboratedType.getClassKind().equals(ASTClassKind.UNION)) { - this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_UNION, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_UNION, ICSearchConstants.DECLARATIONS),elaboratedType.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } @@ -297,20 +297,20 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea } public void addFunctionDeclaration(IASTFunction function, int fileNumber){ - this.output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_DECL,FUNCTION_DECL_LENGTH),function.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_DECL,FUNCTION_DECL_LENGTH),function.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); Iterator i=function.getParameters(); while (i.hasNext()){ Object parm = i.next(); if (parm instanceof IASTParameterDeclaration){ IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm; - this.output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),parmDecl.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),parmDecl.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } } } public void addFunctionReference(IASTFunction function, int fileNumber){ - this.output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_REF,FUNCTION_REF_LENGTH),function.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_REF,FUNCTION_REF_LENGTH),function.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addNameReference(){ @@ -318,15 +318,15 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea } public void addNamespaceDefinition(IASTNamespaceDefinition namespace, int fileNumber){ - this.output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_DECL,NAMESPACE_DECL_LENGTH),namespace.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_DECL,NAMESPACE_DECL_LENGTH),namespace.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addNamespaceReference(IASTNamespaceDefinition namespace, int fileNumber) { - this.output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_REF,NAMESPACE_REF_LENGTH),namespace.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_REF,NAMESPACE_REF_LENGTH),namespace.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } public void addTypedefReference( IASTTypedefDeclaration typedef, int fileNumber ){ - this.output.addRef(fileNumber,encodeTypeEntry( typedef.getFullyQualifiedNameCharArrays(), TYPEDEF, ICSearchConstants.REFERENCES),typedef.getStartingOffset(),ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber,encodeTypeEntry( typedef.getFullyQualifiedNameCharArrays(), TYPEDEF, ICSearchConstants.REFERENCES),typedef.getStartingOffset(),1, ICIndexStorageConstants.OFFSET); } private void addSuperTypeReference(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, char classOrInterface, char[] superTypeName, char superClassOrInterface){ @@ -357,15 +357,15 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea if (classKind.equals(ASTClassKind.CLASS)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,CLASS, ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,CLASS, ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } else if (classKind.equals(ASTClassKind.STRUCT)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,STRUCT,ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,STRUCT,ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } else if (classKind.equals(ASTClassKind.UNION)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,UNION,ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,UNION,ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } } public void addForwardClassReference(IASTTypeSpecifier reference, int fileNumber){ @@ -385,15 +385,15 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea if (classKind.equals(ASTClassKind.CLASS)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_CLASS, ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_CLASS, ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } else if (classKind.equals(ASTClassKind.STRUCT)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_STRUCT,ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_STRUCT,ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } else if (classKind.equals(ASTClassKind.UNION)) { - this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_UNION,ICSearchConstants.REFERENCES),offset,ICIndexStorageConstants.OFFSET); + this.output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_UNION,ICSearchConstants.REFERENCES),offset,1, ICIndexStorageConstants.OFFSET); } } /** @@ -868,7 +868,7 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea incName[0] = inclusion.getFullFileName().toCharArray(); //TODO: Kludge! Get rid of BOGUS entry - need to restructure Dep Tree to use reference indexes int BOGUS_ENTRY = 1; - this.output.addRef(fileNumber, encodeEntry(incName, INCLUDE_REF, INCLUDE_REF_LENGTH),1,ICIndexStorageConstants.LINE); + this.output.addRef(fileNumber, encodeEntry(incName, INCLUDE_REF, INCLUDE_REF_LENGTH),1,1, ICIndexStorageConstants.LINE); }