mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Refactoring of SourceIndexer to use new IIndexerOutput
Refactoring of IndexerOutput
This commit is contained in:
parent
657c53d31e
commit
cee31b91f4
4 changed files with 162 additions and 296 deletions
|
@ -19,67 +19,13 @@ import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||||
|
|
||||||
public interface IIndexerOutput {
|
public interface IIndexerOutput {
|
||||||
|
|
||||||
public void addEnumtorDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addEnumtorRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addMacroDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addMacroRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFieldDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFieldRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addMethodDecl(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType);
|
|
||||||
public void addMethodDefn(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType);
|
|
||||||
public void addMethodRef(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFunctionDecl(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFunctionDefn(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFunctionRef(int indexedFileNumber, char [][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addNamespaceDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addNamespaceRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addIncludeRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addStructDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addStructRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addTypedefDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addTypedefRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addUnionDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addUnionRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addVariableDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addVariableRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addClassDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addClassRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addEnumDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addEnumRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addDerivedDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addDerivedRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFriendDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFriendRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFwd_ClassDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFwd_ClassRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFwd_StructDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFwd_StructRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addFwd_UnionDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
public void addFwd_UnionRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
|
||||||
|
|
||||||
public void addIndexEntry(IIndexEntry indexEntry);
|
public void addIndexEntry(IIndexEntry indexEntry);
|
||||||
|
|
||||||
public IndexedFileEntry getIndexedFile(String path);
|
public IndexedFileEntry getIndexedFile(String path);
|
||||||
public IndexedFileEntry addIndexedFile(String path);
|
public IndexedFileEntry addIndexedFile(String path);
|
||||||
|
|
||||||
//For Dep Tree
|
//For Dep Tree
|
||||||
// public void addIncludeRef(int indexedFileNumber, char[] word);
|
public void addIncludeRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||||
public void addIncludeRef(int indexedFileNumber, String word);
|
public void addIncludeRef(int indexedFileNumber, String word);
|
||||||
public void addRelatives(int indexedFileNumber, String inclusion, String parent);
|
public void addRelatives(int indexedFileNumber, String inclusion, String parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,154 +89,10 @@ public class IndexerOutput implements ICIndexStorageConstants, IIndexerOutput {
|
||||||
return index.addFile(path);
|
return index.addFile(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEnumtorDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.ENUMTOR, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEnumtorRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.ENUMTOR, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMacroDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.MACRO, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMacroRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.MACRO, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFieldDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.FIELD, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFieldRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.FIELD, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMethodDecl(int indexedFileNumber, char[][] name, /*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.METHOD, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMethodDefn(int indexedFileNumber, char[][] name, /*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.METHOD, IIndex.DEFINITION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addMethodRef(int indexedFileNumber, char[][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.METHOD, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFunctionDecl(int indexedFileNumber, char[][] name,/*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.FUNCTION, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFunctionDefn(int indexedFileNumber, char[][] name, /*char[][] parameterTypes,*/ int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.FUNCTION, IIndex.DEFINITION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFunctionRef(int indexedFileNumber, char[][] name, /*char[][] parameterTypes,*/int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.FUNCTION, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addNamespaceDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.NAMESPACE, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addNamespaceRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, IIndex.NAMESPACE, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addIncludeRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
public void addIncludeRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||||
addRef(indexedFileNumber, name, IIndex.INCLUDE, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
addRef(indexedFileNumber, name, IIndex.INCLUDE, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addStructDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, STRUCT_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addStructRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, STRUCT_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addTypedefDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, TYPEDEF_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addTypedefRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, TYPEDEF_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addUnionDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, UNION_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addUnionRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, UNION_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addVariableDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, VAR_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addVariableRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, VAR_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addClassDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, CLASS_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addClassRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, CLASS_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEnumDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, ENUM_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEnumRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, ENUM_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addDerivedDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, DERIVED_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addDerivedRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, DERIVED_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFriendDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FRIEND_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFriendRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FRIEND_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_ClassDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_CLASS_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_ClassRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_CLASS_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_StructDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_STRUCT_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_StructRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_STRUCT_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_UnionDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_UNION_SUFFIX, IIndex.DECLARATION, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addFwd_UnionRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
|
||||||
addRef(indexedFileNumber, name, FWD_UNION_SUFFIX, IIndex.REFERENCE, offset,offsetLength, offsetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/' TypeName ['/' Qualifier]*
|
* Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/' TypeName ['/' Qualifier]*
|
||||||
*/
|
*/
|
||||||
|
@ -382,48 +238,4 @@ public class IndexerOutput implements ICIndexStorageConstants, IIndexerOutput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static final char[] encodeEntry(char[][] elementName, int entryType, int encodeType) {
|
|
||||||
// // Temporarily
|
|
||||||
// if (elementName == null) {
|
|
||||||
// return "NPE".toCharArray(); //$NON-NLS-1$
|
|
||||||
// }
|
|
||||||
// int pos, nameLength = 0;
|
|
||||||
// for (int i=0; i < elementName.length; i++){
|
|
||||||
// char[] namePart = elementName[i];
|
|
||||||
// nameLength += namePart.length;
|
|
||||||
// }
|
|
||||||
// char[][] encodedTypeNames = null;
|
|
||||||
// if (encodeType == IIndex.DECLARATION) {
|
|
||||||
// encodedTypeNames = IIndexEncodingConstants.encodedTypeNames_Decl;
|
|
||||||
// }
|
|
||||||
// else if (encodeType == IIndex.REFERENCE) {
|
|
||||||
// encodedTypeNames = IIndexEncodingConstants.encodedTypeNames_Ref;
|
|
||||||
// }
|
|
||||||
// char[] encodedTypeName = encodedTypeNames[entryType];
|
|
||||||
//
|
|
||||||
// //char[] has to be of size - [type length + length of the name (including qualifiers) +
|
|
||||||
// //separators (need one less than fully qualified name length)
|
|
||||||
// char[] result = new char[encodedTypeName.length + nameLength + elementName.length - 1];
|
|
||||||
// System.arraycopy(encodedTypeName, 0, result, 0, pos = encodedTypeName.length);
|
|
||||||
// if (elementName.length > 0) {
|
|
||||||
// //Extract the name first
|
|
||||||
// char [] tempName = elementName[elementName.length-1];
|
|
||||||
// System.arraycopy(tempName, 0, result, pos, tempName.length);
|
|
||||||
// pos += tempName.length;
|
|
||||||
// }
|
|
||||||
// //Extract the qualifiers
|
|
||||||
// for (int i=elementName.length - 2; i>=0; i--){
|
|
||||||
// result[pos++] = SEPARATOR;
|
|
||||||
// char [] tempName = elementName[i];
|
|
||||||
// System.arraycopy(tempName, 0, result, pos, tempName.length);
|
|
||||||
// pos+=tempName.length;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (AbstractIndexer.VERBOSE)
|
|
||||||
// AbstractIndexer.verbose(new String(result));
|
|
||||||
//
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,6 @@ class CTagEntry{
|
||||||
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
typeEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
||||||
typeEntry.serialize(output);
|
typeEntry.serialize(output);
|
||||||
} else if (kind.equals(CTagsConsoleParser.MEMBER)){
|
} else if (kind.equals(CTagsConsoleParser.MEMBER)){
|
||||||
output.addFieldDecl(fileNum, fullName, lineNumber, 1, IIndex.LINE);
|
|
||||||
NamedEntry namedEntry = new NamedEntry(IIndex.FIELD, IIndex.DECLARATION,fullName,getModifiers(),fileNum);
|
NamedEntry namedEntry = new NamedEntry(IIndex.FIELD, IIndex.DECLARATION,fullName,getModifiers(),fileNum);
|
||||||
namedEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
namedEntry.setNameOffset(lineNumber, 1, IIndex.LINE);
|
||||||
namedEntry.serialize(output);
|
namedEntry.serialize(output);
|
||||||
|
|
|
@ -64,7 +64,10 @@ import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTTypedefReference;
|
import org.eclipse.cdt.core.parser.ast.IASTTypedefReference;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
|
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
|
||||||
|
import org.eclipse.cdt.internal.core.index.FunctionEntry;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||||
|
import org.eclipse.cdt.internal.core.index.NamedEntry;
|
||||||
|
import org.eclipse.cdt.internal.core.index.TypeEntry;
|
||||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||||
import org.eclipse.cdt.internal.core.index.impl.IndexDelta;
|
import org.eclipse.cdt.internal.core.index.impl.IndexDelta;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
@ -266,7 +269,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = baseClassSpec.getNameOffset();
|
int offset = baseClassSpec.getNameOffset();
|
||||||
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
||||||
output.addDerivedDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_DERIVED ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
} catch (ASTNotImplementedException e) {}
|
} catch (ASTNotImplementedException e) {}
|
||||||
}
|
}
|
||||||
|
@ -280,14 +286,20 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = friendClassSpec.getNameOffset();
|
int offset = friendClassSpec.getNameOffset();
|
||||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName,offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FRIEND ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset,offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
||||||
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
||||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = friendClassSpec.getNameOffset();
|
int offset = friendClassSpec.getNameOffset();
|
||||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FRIEND ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset,offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (decl instanceof IASTFunction){
|
else if (decl instanceof IASTFunction){
|
||||||
|
|
||||||
|
@ -300,7 +312,11 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
int offset = classSpecification.getNameOffset();
|
int offset = classSpecification.getNameOffset();
|
||||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||||
output.addClassDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_CLASS,IIndex.DECLARATION, classSpecification.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT))
|
else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT))
|
||||||
{
|
{
|
||||||
|
@ -315,7 +331,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = baseClassSpec.getNameOffset();
|
int offset = baseClassSpec.getNameOffset();
|
||||||
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
||||||
output.addDerivedDecl(fileNumber, baseFullyQualifiedName, offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_DERIVED ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
} catch (ASTNotImplementedException e) {}
|
} catch (ASTNotImplementedException e) {}
|
||||||
}
|
}
|
||||||
|
@ -329,14 +348,20 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = friendClassSpec.getNameOffset();
|
int offset = friendClassSpec.getNameOffset();
|
||||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FRIEND ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset,offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
||||||
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
||||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||||
int offset = friendClassSpec.getNameOffset();
|
int offset = friendClassSpec.getNameOffset();
|
||||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FRIEND ,IIndex.DECLARATION, baseFullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset,offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (decl instanceof IASTFunction){
|
else if (decl instanceof IASTFunction){
|
||||||
|
|
||||||
|
@ -348,13 +373,21 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
int offset = classSpecification.getNameOffset();
|
int offset = classSpecification.getNameOffset();
|
||||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||||
output.addStructDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_STRUCT,IIndex.DECLARATION, classSpecification.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classSpecification.getClassKind().equals(ASTClassKind.UNION))
|
else if (classSpecification.getClassKind().equals(ASTClassKind.UNION))
|
||||||
{
|
{
|
||||||
int offset = classSpecification.getNameOffset();
|
int offset = classSpecification.getNameOffset();
|
||||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||||
output.addUnionDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_UNION,IIndex.DECLARATION, classSpecification.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset,offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +395,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
int offset = enumeration.getNameOffset();
|
int offset = enumeration.getNameOffset();
|
||||||
int offsetLength = enumeration.getNameEndOffset() - offset;
|
int offsetLength = enumeration.getNameEndOffset() - offset;
|
||||||
output.addEnumDecl(fileNumber, enumeration.getFullyQualifiedNameCharArrays(), offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_ENUM ,IIndex.DECLARATION, enumeration.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
|
|
||||||
Iterator i = enumeration.getEnumerators();
|
Iterator i = enumeration.getEnumerators();
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
|
@ -373,8 +409,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
offset = en.getNameOffset();
|
offset = en.getNameOffset();
|
||||||
offsetLength = en.getNameEndOffset() - offset;
|
offsetLength = en.getNameEndOffset() - offset;
|
||||||
output.addEnumtorDecl(fileNumber, enumeratorFullName, offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.ENUMTOR, IIndex.DECLARATION, enumeratorFullName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,65 +433,97 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
IASTEnumerator enumerator = (IASTEnumerator)reference.getReferencedElement();
|
IASTEnumerator enumerator = (IASTEnumerator)reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = enumerator.getNameEndOffset() - enumerator.getNameOffset();
|
int offsetLength = enumerator.getNameEndOffset() - enumerator.getNameOffset();
|
||||||
output.addEnumtorRef(fileNumber, createEnumeratorFullyQualifiedName(enumerator),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.ENUMTOR, IIndex.REFERENCE, createEnumeratorFullyQualifiedName(enumerator), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMacro(IASTMacro macro, int fileNumber) {
|
public void addMacro(IASTMacro macro, int fileNumber) {
|
||||||
char[][] macroName = new char[][] { macro.getNameCharArray() };
|
char[][] macroName = new char[][] { macro.getNameCharArray() };
|
||||||
int offset = macro.getNameOffset();
|
int offset = macro.getNameOffset();
|
||||||
int offsetLength = macro.getNameEndOffset() - offset;
|
int offsetLength = macro.getNameEndOffset() - offset;
|
||||||
output.addMacroDecl(fileNumber, macroName, offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.MACRO, IIndex.DECLARATION, macroName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEnumerationReference(IASTEnumerationReference reference, int fileNumber) {
|
public void addEnumerationReference(IASTEnumerationReference reference, int fileNumber) {
|
||||||
IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier) reference.getReferencedElement();
|
IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = enumeration.getNameEndOffset() - enumeration.getNameOffset();
|
int offsetLength = enumeration.getNameEndOffset() - enumeration.getNameOffset();
|
||||||
output.addEnumRef(fileNumber, enumeration.getFullyQualifiedNameCharArrays(), offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_ENUM ,IIndex.REFERENCE, enumeration.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
public void addVariable(IASTVariable variable, int fileNumber) {
|
public void addVariable(IASTVariable variable, int fileNumber) {
|
||||||
int offset = variable.getNameOffset();
|
int offset = variable.getNameOffset();
|
||||||
int offsetLength = variable.getNameEndOffset() - offset;
|
int offsetLength = variable.getNameEndOffset() - offset;
|
||||||
output.addVariableDecl(fileNumber, variable.getFullyQualifiedNameCharArrays(), offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_VAR ,IIndex.DECLARATION, variable.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addVariableReference(IASTVariableReference reference, int fileNumber) {
|
public void addVariableReference(IASTVariableReference reference, int fileNumber) {
|
||||||
IASTVariable variable = (IASTVariable)reference.getReferencedElement();
|
IASTVariable variable = (IASTVariable)reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = variable.getNameEndOffset() - variable.getNameOffset();
|
int offsetLength = variable.getNameEndOffset() - variable.getNameOffset();
|
||||||
output.addVariableRef(fileNumber, variable.getFullyQualifiedNameCharArrays(), offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_VAR ,IIndex.REFERENCE, variable.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParameterReference( IASTParameterReference reference, int fileNumber ){
|
public void addParameterReference( IASTParameterReference reference, int fileNumber ){
|
||||||
IASTParameterDeclaration parameter = (IASTParameterDeclaration) reference.getReferencedElement();
|
IASTParameterDeclaration parameter = (IASTParameterDeclaration) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = parameter.getNameEndOffset() - parameter.getNameOffset();
|
int offsetLength = parameter.getNameEndOffset() - parameter.getNameOffset();
|
||||||
output.addVariableRef(fileNumber, new char[][] { parameter.getNameCharArray() }, offset, offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_VAR ,IIndex.REFERENCE, new char[][]{parameter.getNameCharArray()}, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTypedefDeclaration(IASTTypedefDeclaration typedef, int fileNumber) {
|
public void addTypedefDeclaration(IASTTypedefDeclaration typedef, int fileNumber) {
|
||||||
int offset = typedef.getNameOffset();
|
int offset = typedef.getNameOffset();
|
||||||
int offsetLength = typedef.getNameEndOffset() - offset;
|
int offsetLength = typedef.getNameEndOffset() - offset;
|
||||||
output.addTypedefDecl(fileNumber,typedef.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_TYPEDEF, IIndex.DECLARATION, typedef.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFieldDeclaration(IASTField field, int fileNumber) {
|
public void addFieldDeclaration(IASTField field, int fileNumber) {
|
||||||
int offset = field.getNameOffset();
|
int offset = field.getNameOffset();
|
||||||
int offsetLength = field.getNameEndOffset() - offset;
|
int offsetLength = field.getNameEndOffset() - offset;
|
||||||
output.addFieldDecl(fileNumber, field.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.FIELD, IIndex.DECLARATION, field.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFieldReference(IASTFieldReference reference, int fileNumber) {
|
public void addFieldReference(IASTFieldReference reference, int fileNumber) {
|
||||||
IASTField field=(IASTField) reference.getReferencedElement();
|
IASTField field=(IASTField) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = field.getNameEndOffset() - field.getNameOffset();
|
int offsetLength = field.getNameEndOffset() - field.getNameOffset();
|
||||||
output.addFieldRef(fileNumber, field.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.FIELD, IIndex.REFERENCE, field.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMethodDeclaration(IASTMethod method, int fileNumber) {
|
public void addMethodDeclaration(IASTMethod method, int fileNumber) {
|
||||||
int offset = method.getNameOffset();
|
int offset = method.getNameOffset();
|
||||||
int offsetLength = method.getNameEndOffset() - offset;
|
int offsetLength = method.getNameEndOffset() - offset;
|
||||||
output.addMethodDecl(fileNumber, method.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
FunctionEntry functionEntry = new FunctionEntry(IIndex.METHOD, IIndex.DECLARATION, method.getFullyQualifiedNameCharArrays(),0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
functionEntry.serialize(output);
|
||||||
|
|
||||||
Iterator i=method.getParameters();
|
Iterator i=method.getParameters();
|
||||||
while (i.hasNext()){
|
while (i.hasNext()){
|
||||||
|
@ -462,7 +532,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
||||||
offset = parmDecl.getNameOffset();
|
offset = parmDecl.getNameOffset();
|
||||||
offsetLength = parmDecl.getNameEndOffset() - offset;
|
offsetLength = parmDecl.getNameEndOffset() - offset;
|
||||||
output.addVariableDecl(fileNumber, new char[][]{parmDecl.getNameCharArray()},offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_VAR ,IIndex.DECLARATION, new char[][]{parmDecl.getNameCharArray()}, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,7 +544,11 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
IASTMethod method = (IASTMethod) reference.getReferencedElement();
|
IASTMethod method = (IASTMethod) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = method.getNameEndOffset() - method.getNameOffset();
|
int offsetLength = method.getNameEndOffset() - method.getNameOffset();
|
||||||
output.addMethodRef(fileNumber, method.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
FunctionEntry functionEntry = new FunctionEntry(IIndex.METHOD, IIndex.REFERENCE, method.getFullyQualifiedNameCharArrays(),0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
functionEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addElaboratedForwardDeclaration(IASTElaboratedTypeSpecifier elaboratedType, int fileNumber) {
|
public void addElaboratedForwardDeclaration(IASTElaboratedTypeSpecifier elaboratedType, int fileNumber) {
|
||||||
|
@ -480,15 +557,21 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
if (elaboratedType.getClassKind().equals(ASTClassKind.CLASS))
|
if (elaboratedType.getClassKind().equals(ASTClassKind.CLASS))
|
||||||
{
|
{
|
||||||
output.addFwd_ClassDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_CLASS ,IIndex.DECLARATION, elaboratedType.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (elaboratedType.getClassKind().equals(ASTClassKind.STRUCT))
|
else if (elaboratedType.getClassKind().equals(ASTClassKind.STRUCT))
|
||||||
{
|
{
|
||||||
output.addFwd_StructDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_STRUCT ,IIndex.DECLARATION, elaboratedType.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (elaboratedType.getClassKind().equals(ASTClassKind.UNION))
|
else if (elaboratedType.getClassKind().equals(ASTClassKind.UNION))
|
||||||
{
|
{
|
||||||
output.addFwd_UnionDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_UNION,IIndex.DECLARATION, elaboratedType.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +593,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
int offset = function.getNameOffset();
|
int offset = function.getNameOffset();
|
||||||
int offsetLength = function.getNameEndOffset() - offset;
|
int offsetLength = function.getNameEndOffset() - offset;
|
||||||
|
|
||||||
output.addFunctionDecl(fileNumber, function.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
FunctionEntry functionEntry = new FunctionEntry(IIndex.FUNCTION, IIndex.DECLARATION, function.getFullyQualifiedNameCharArrays(),0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
functionEntry.serialize(output);
|
||||||
|
|
||||||
Iterator i=function.getParameters();
|
Iterator i=function.getParameters();
|
||||||
while (i.hasNext()){
|
while (i.hasNext()){
|
||||||
|
@ -519,7 +605,10 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
||||||
offset = parmDecl.getNameOffset();
|
offset = parmDecl.getNameOffset();
|
||||||
offsetLength = parmDecl.getNameEndOffset() - offset;
|
offsetLength = parmDecl.getNameEndOffset() - offset;
|
||||||
output.addVariableDecl(fileNumber, new char[][]{parmDecl.getNameCharArray()},offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_VAR ,IIndex.DECLARATION, new char[][]{parmDecl.getNameCharArray()}, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +617,11 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
IASTFunction function=(IASTFunction) reference.getReferencedElement();
|
IASTFunction function=(IASTFunction) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = function.getNameEndOffset() - function.getNameOffset();
|
int offsetLength = function.getNameEndOffset() - function.getNameOffset();
|
||||||
output.addFunctionRef(fileNumber, function.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
FunctionEntry functionEntry = new FunctionEntry(IIndex.FUNCTION, IIndex.REFERENCE, function.getFullyQualifiedNameCharArrays(),0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
functionEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addNameReference(){
|
public void addNameReference(){
|
||||||
|
@ -538,29 +631,30 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
public void addNamespaceDefinition(IASTNamespaceDefinition namespace, int fileNumber){
|
public void addNamespaceDefinition(IASTNamespaceDefinition namespace, int fileNumber){
|
||||||
int offset = namespace.getNameOffset();
|
int offset = namespace.getNameOffset();
|
||||||
int offsetLength = namespace.getNameEndOffset() - offset;
|
int offsetLength = namespace.getNameEndOffset() - offset;
|
||||||
output.addNamespaceDecl(fileNumber, namespace.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.NAMESPACE, IIndex.DECLARATION, namespace.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addNamespaceReference(IASTNamespaceReference reference, int fileNumber) {
|
public void addNamespaceReference(IASTNamespaceReference reference, int fileNumber) {
|
||||||
IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)reference.getReferencedElement();
|
IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = namespace.getNameEndOffset() - namespace.getNameOffset();
|
int offsetLength = namespace.getNameEndOffset() - namespace.getNameOffset();
|
||||||
output.addNamespaceRef(fileNumber, namespace.getFullyQualifiedNameCharArrays(),offset,offsetLength, IIndex.OFFSET);
|
|
||||||
|
NamedEntry namedEntry = new NamedEntry(IIndex.NAMESPACE, IIndex.REFERENCE, namespace.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
namedEntry.serialize(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTypedefReference( IASTTypedefReference reference, int fileNumber ){
|
public void addTypedefReference( IASTTypedefReference reference, int fileNumber ){
|
||||||
IASTTypedefDeclaration typedef = (IASTTypedefDeclaration) reference.getReferencedElement();
|
IASTTypedefDeclaration typedef = (IASTTypedefDeclaration) reference.getReferencedElement();
|
||||||
int offset = reference.getOffset();
|
int offset = reference.getOffset();
|
||||||
int offsetLength = typedef.getNameEndOffset() - typedef.getNameOffset();
|
int offsetLength = typedef.getNameEndOffset() - typedef.getNameOffset();
|
||||||
output.addTypedefRef(fileNumber, typedef.getFullyQualifiedNameCharArrays(), offset, offsetLength, IIndex.OFFSET);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addSuperTypeReference(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, char classOrInterface, char[] superTypeName, char superClassOrInterface){
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_TYPEDEF, IIndex.REFERENCE, typedef.getFullyQualifiedNameCharArrays(), 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
}
|
typeEntry.serialize(output);
|
||||||
|
|
||||||
public void addTypeReference(char[] typeName){
|
|
||||||
//output.addRef(CharOperation.concat(TYPE_REF, CharOperation.lastSegment(typeName, '.')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addClassReference(IASTClassReference reference, int fileNumber){
|
public void addClassReference(IASTClassReference reference, int fileNumber){
|
||||||
|
@ -586,15 +680,24 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
if (classKind.equals(ASTClassKind.CLASS))
|
if (classKind.equals(ASTClassKind.CLASS))
|
||||||
{
|
{
|
||||||
output.addClassRef(fileNumber, fullyQualifiedName,offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_CLASS,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classKind.equals(ASTClassKind.STRUCT))
|
else if (classKind.equals(ASTClassKind.STRUCT))
|
||||||
{
|
{
|
||||||
output.addStructRef(fileNumber, fullyQualifiedName,offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_STRUCT,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classKind.equals(ASTClassKind.UNION))
|
else if (classKind.equals(ASTClassKind.UNION))
|
||||||
{
|
{
|
||||||
output.addUnionRef(fileNumber, fullyQualifiedName,offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_UNION,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,15 +720,21 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
||||||
|
|
||||||
if (classKind.equals(ASTClassKind.CLASS))
|
if (classKind.equals(ASTClassKind.CLASS))
|
||||||
{
|
{
|
||||||
output.addFwd_ClassRef(fileNumber, fullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_CLASS ,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classKind.equals(ASTClassKind.STRUCT))
|
else if (classKind.equals(ASTClassKind.STRUCT))
|
||||||
{
|
{
|
||||||
output.addFwd_StructRef(fileNumber, fullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_STRUCT ,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
else if (classKind.equals(ASTClassKind.UNION))
|
else if (classKind.equals(ASTClassKind.UNION))
|
||||||
{
|
{
|
||||||
output.addFwd_UnionRef(fileNumber, fullyQualifiedName, offset,offsetLength, IIndex.OFFSET);
|
TypeEntry typeEntry = new TypeEntry(IIndex.TYPE_FWD_UNION ,IIndex.REFERENCE, fullyQualifiedName, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, offsetLength, IIndex.OFFSET);
|
||||||
|
typeEntry.serialize(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue