mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Refactoring for the DOM Indexer to use new IIndexEntry encoding
This commit is contained in:
parent
86baacedc8
commit
3720c60ebd
6 changed files with 203 additions and 118 deletions
|
@ -13,8 +13,8 @@ package org.eclipse.cdt.internal.core.index;
|
||||||
|
|
||||||
public class FunctionEntry extends NamedEntry implements IFunctionEntry {
|
public class FunctionEntry extends NamedEntry implements IFunctionEntry {
|
||||||
|
|
||||||
|
|
||||||
char[][] signature;
|
char[][] signature;
|
||||||
|
char[] returnString;
|
||||||
|
|
||||||
public FunctionEntry(int metakind, int entry_type, char[][] fullName, int modifiers,int fileNumber){
|
public FunctionEntry(int metakind, int entry_type, char[][] fullName, int modifiers,int fileNumber){
|
||||||
super(metakind,entry_type,fullName, modifiers, fileNumber);
|
super(metakind,entry_type,fullName, modifiers, fileNumber);
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2005 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.internal.core.index;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic indexer query interface to allow for queries of any existing indexer storage mechanism
|
||||||
|
* To be considered in development.
|
||||||
|
* @author bgheorgh
|
||||||
|
* @since 3.0
|
||||||
|
*/
|
||||||
|
public interface IIndexQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Metakind bit field constants
|
||||||
|
*/
|
||||||
|
final static int CLASS = 1;
|
||||||
|
final static int STRUCT = 2;
|
||||||
|
final static int UNION = 4;
|
||||||
|
final static int ENUM = 8;
|
||||||
|
final static int VAR = 16;
|
||||||
|
final static int TYPEDEF = 32;
|
||||||
|
final static int FUNCTION = 64;
|
||||||
|
final static int METHOD = 128;
|
||||||
|
final static int FIELD = 256;
|
||||||
|
final static int MACRO = 512;
|
||||||
|
final static int NAMESPACE = 1024;
|
||||||
|
final static int ENUMTOR = 2048;
|
||||||
|
final static int INCLUDE = 4096;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type bit field
|
||||||
|
*/
|
||||||
|
final static int DECLARATION = 1;
|
||||||
|
final static int DEFINITION = 2;
|
||||||
|
final static int REFERENCE= 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the entries in the index corresponding to the passed in:
|
||||||
|
*
|
||||||
|
* @param metakind - bit field that indicates the kinds to retrieve
|
||||||
|
* @param type - bit field that indiciates what type of kinds to look for
|
||||||
|
* @param pattern - String array that contains the elements of a pattern;
|
||||||
|
* the interpretation of this array is left up to the implementor; can be left null
|
||||||
|
* in which case a match is attempted based on the metakind and type fields
|
||||||
|
* @param path - an IPath array that is used to limit the query; can be null to indicate
|
||||||
|
* entire workspace
|
||||||
|
*
|
||||||
|
* @return IIndexEntry
|
||||||
|
*/
|
||||||
|
IIndexEntry[] getIndexEntries(int metakind, int type, String[] pattern, IPath[] paths);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the entries in the index corresponding to the passed in:
|
||||||
|
*
|
||||||
|
* @param metakind - bit field that indicates the kinds to retrieve
|
||||||
|
* @param type - bit field that indiciates what type of kinds to look for
|
||||||
|
* @param pattern - String array that contains the elements of a pattern;
|
||||||
|
* the interpretation of this array is left up to the implementor; can be left null
|
||||||
|
* in which case a match is attempted based on the metakind and type fields
|
||||||
|
* @param projects - an IProject array that contains the projects that are to be queried
|
||||||
|
*
|
||||||
|
* @return IIndexEntry
|
||||||
|
*/
|
||||||
|
IIndexEntry[] getIndexEntries(int metakind, int type, String[] pattern, IProject[] projects);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the entries in the index corresponding to the passed in:
|
||||||
|
*
|
||||||
|
* @param metakind - bit field that indicates the kinds to retrieve
|
||||||
|
* @param type - bit field that indiciates what type of kinds to look for
|
||||||
|
* @param pattern - String array that contains the elements of a pattern;
|
||||||
|
* the interpretation of this array is left up to the implementor; can be left null
|
||||||
|
* in which case a match is attempted based on the metakind and type fields
|
||||||
|
* @param projects - an IProject array that contains the projects that are to be queried
|
||||||
|
* @param additionalPaths - an array for additional paths to query
|
||||||
|
*
|
||||||
|
* @return IIndexEntry
|
||||||
|
*/
|
||||||
|
IIndexEntry[] getIndexEntries(int metakind, int type, String[] pattern, IProject[] projects, IPath[] additionalPaths);
|
||||||
|
|
||||||
|
}
|
|
@ -156,26 +156,26 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
||||||
entryType = IndexerOutputWrapper.FUNCTION;
|
entryType = IndexerOutputWrapper.FUNCTION;
|
||||||
|
|
||||||
if (entryType != null) {
|
if (entryType != null) {
|
||||||
|
int entryKind=0;
|
||||||
if (name.isDeclaration()) {
|
if (name.isDeclaration()) {
|
||||||
IndexerOutputWrapper.addNameDecl(indexer.getOutput(),
|
entryKind=IIndex.DECLARATION;
|
||||||
getFullyQualifiedName(name),
|
}/* else if (name.isDefinition()){
|
||||||
entryType,
|
entryKind=IIndex.DEFINITION;
|
||||||
fileNumber,
|
}*/
|
||||||
loc.getNodeOffset(),
|
|
||||||
loc.getNodeLength(),
|
|
||||||
IIndex.OFFSET);
|
|
||||||
}
|
|
||||||
else if (name.isReference()) {
|
else if (name.isReference()) {
|
||||||
IndexerOutputWrapper.addNameRef(indexer.getOutput(),
|
entryKind=IIndex.REFERENCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
IndexerOutputWrapper.addIndexEntry(indexer.getOutput(),
|
||||||
getFullyQualifiedName(name),
|
getFullyQualifiedName(name),
|
||||||
entryType,
|
entryType,
|
||||||
|
entryKind,
|
||||||
fileNumber,
|
fileNumber,
|
||||||
loc.getNodeOffset(),
|
loc.getNodeOffset(),
|
||||||
loc.getNodeLength(),
|
loc.getNodeLength(),
|
||||||
IIndex.OFFSET);
|
IIndex.OFFSET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param name
|
* @param name
|
||||||
|
|
|
@ -143,6 +143,9 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
||||||
if (name.isDeclaration()) {
|
if (name.isDeclaration()) {
|
||||||
limitTo = ICSearchConstants.DECLARATIONS;
|
limitTo = ICSearchConstants.DECLARATIONS;
|
||||||
}
|
}
|
||||||
|
else if (name.isDefinition()){
|
||||||
|
limitTo = ICSearchConstants.DEFINITIONS;
|
||||||
|
}
|
||||||
else if (name.isReference()) {
|
else if (name.isReference()) {
|
||||||
limitTo = ICSearchConstants.REFERENCES;
|
limitTo = ICSearchConstants.REFERENCES;
|
||||||
}
|
}
|
||||||
|
@ -217,24 +220,26 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entryType != null) {
|
if (entryType != null) {
|
||||||
|
int entryKind =0;
|
||||||
if (limitTo == ICSearchConstants.DECLARATIONS) {
|
if (limitTo == ICSearchConstants.DECLARATIONS) {
|
||||||
IndexerOutputWrapper.addNameDecl(indexer.getOutput(),
|
entryKind = IIndex.DECLARATION;
|
||||||
getFullyQualifiedName(binding),
|
|
||||||
entryType,
|
|
||||||
fileNumber,
|
|
||||||
loc.getNodeOffset(),
|
|
||||||
loc.getNodeLength(),
|
|
||||||
IIndex.OFFSET);
|
|
||||||
}
|
}
|
||||||
|
/*else if (limitTo == ICSearchConstants.DEFINITIONS) {
|
||||||
|
entryKind = IIndex.DEFINITION;
|
||||||
|
}*/
|
||||||
else if (limitTo == ICSearchConstants.REFERENCES) {
|
else if (limitTo == ICSearchConstants.REFERENCES) {
|
||||||
IndexerOutputWrapper.addNameRef(indexer.getOutput(),
|
entryKind = IIndex.REFERENCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
IndexerOutputWrapper.addIndexEntry(indexer.getOutput(),
|
||||||
getFullyQualifiedName(binding),
|
getFullyQualifiedName(binding),
|
||||||
entryType,
|
entryType,
|
||||||
|
entryKind,
|
||||||
fileNumber,
|
fileNumber,
|
||||||
loc.getNodeOffset(),
|
loc.getNodeOffset(),
|
||||||
loc.getNodeLength(),
|
loc.getNodeLength(),
|
||||||
IIndex.OFFSET);
|
IIndex.OFFSET);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,8 +256,9 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
||||||
if (compositeKey == ICPPClassType.k_class || compositeKey == ICompositeType.k_struct) {
|
if (compositeKey == ICPPClassType.k_class || compositeKey == ICompositeType.k_struct) {
|
||||||
if (prop == ICPPASTBaseSpecifier.NAME) {
|
if (prop == ICPPASTBaseSpecifier.NAME) {
|
||||||
// base class
|
// base class
|
||||||
IndexerOutputWrapper.addNameDecl(indexer.getOutput(), getFullyQualifiedName(compBinding),
|
IndexerOutputWrapper.addIndexEntry(indexer.getOutput(), getFullyQualifiedName(compBinding),
|
||||||
IndexerOutputWrapper.DERIVED,
|
IndexerOutputWrapper.DERIVED,
|
||||||
|
IIndex.DECLARATION,
|
||||||
fileNumber,
|
fileNumber,
|
||||||
loc.getNodeOffset(),
|
loc.getNodeOffset(),
|
||||||
loc.getNodeLength(),
|
loc.getNodeLength(),
|
||||||
|
|
|
@ -259,9 +259,10 @@ public class DOMSourceIndexerRunner extends AbstractIndexer {
|
||||||
getOutput().addRelatives(fileNumber, include,
|
getOutput().addRelatives(fileNumber, include,
|
||||||
(parent != null) ? parent.getIncludeDirective().getPath() : null);
|
(parent != null) ? parent.getIncludeDirective().getPath() : null);
|
||||||
|
|
||||||
IndexerOutputWrapper.addNameRef(getOutput(),
|
IndexerOutputWrapper.addIndexEntry(getOutput(),
|
||||||
new char[][] {include.toCharArray()},
|
new char[][] {include.toCharArray()},
|
||||||
IndexerOutputWrapper.INCLUDE,
|
IndexerOutputWrapper.INCLUDE,
|
||||||
|
IIndex.REFERENCE,
|
||||||
fileNumber,
|
fileNumber,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
|
@ -288,9 +289,10 @@ public class DOMSourceIndexerRunner extends AbstractIndexer {
|
||||||
// Get the location
|
// Get the location
|
||||||
IASTFileLocation loc = IndexEncoderUtil.getFileLocation(macro);
|
IASTFileLocation loc = IndexEncoderUtil.getFileLocation(macro);
|
||||||
int fileNumber = IndexEncoderUtil.calculateIndexFlags(this, loc);
|
int fileNumber = IndexEncoderUtil.calculateIndexFlags(this, loc);
|
||||||
IndexerOutputWrapper.addNameDecl(getOutput(),
|
IndexerOutputWrapper.addIndexEntry(getOutput(),
|
||||||
new char[][] {macro.toCharArray()},
|
new char[][] {macro.toCharArray()},
|
||||||
IndexerOutputWrapper.MACRO,
|
IndexerOutputWrapper.MACRO,
|
||||||
|
IIndex.DECLARATION,
|
||||||
fileNumber,
|
fileNumber,
|
||||||
loc.getNodeOffset(),
|
loc.getNodeOffset(),
|
||||||
loc.getNodeLength(),
|
loc.getNodeLength(),
|
||||||
|
|
|
@ -10,7 +10,11 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.domsourceindexer;
|
package org.eclipse.cdt.internal.core.index.domsourceindexer;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.core.index.FunctionEntry;
|
||||||
|
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexerOutput;
|
import org.eclipse.cdt.internal.core.index.IIndexerOutput;
|
||||||
|
import org.eclipse.cdt.internal.core.index.NamedEntry;
|
||||||
|
import org.eclipse.cdt.internal.core.index.TypeEntry;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,9 +78,10 @@ class IndexerOutputWrapper {
|
||||||
private IndexerOutputWrapper() {
|
private IndexerOutputWrapper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addNameDecl(IIndexerOutput indexerOutput,
|
static void addIndexEntry (IIndexerOutput indexerOutput,
|
||||||
char[][] name,
|
char[][] name,
|
||||||
EntryType entryType,
|
EntryType entryType,
|
||||||
|
int entryKind,
|
||||||
int fileNumber,
|
int fileNumber,
|
||||||
int offset,
|
int offset,
|
||||||
int length,
|
int length,
|
||||||
|
@ -84,123 +89,103 @@ class IndexerOutputWrapper {
|
||||||
//TODO temporary until all bindings are completed
|
//TODO temporary until all bindings are completed
|
||||||
if (name == null)
|
if (name == null)
|
||||||
name = new char[][] {"NPE".toCharArray()}; //$NON-NLS-1$
|
name = new char[][] {"NPE".toCharArray()}; //$NON-NLS-1$
|
||||||
|
|
||||||
|
TypeEntry typeEntry;
|
||||||
|
NamedEntry namedEntry;
|
||||||
|
FunctionEntry functionEntry;
|
||||||
|
|
||||||
switch (entryType.toInt()) {
|
switch (entryType.toInt()) {
|
||||||
case CLASS_CONST:
|
case CLASS_CONST:
|
||||||
indexerOutput.addClassDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_CLASS,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case STRUCT_CONST:
|
case STRUCT_CONST:
|
||||||
indexerOutput.addStructDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_STRUCT,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case UNION_CONST:
|
case UNION_CONST:
|
||||||
indexerOutput.addUnionDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_UNION,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
//typeEntry.setBaseTypes(getInherits());
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case ENUM_CONST:
|
case ENUM_CONST:
|
||||||
indexerOutput.addEnumDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_ENUM ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case VAR_CONST:
|
case VAR_CONST:
|
||||||
indexerOutput.addVariableDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_VAR ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case TYPEDEF_CONST:
|
case TYPEDEF_CONST:
|
||||||
indexerOutput.addTypedefDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_TYPEDEF, entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case DERIVED_CONST:
|
case DERIVED_CONST:
|
||||||
indexerOutput.addDerivedDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_DERIVED ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FRIEND_CONST:
|
case FRIEND_CONST:
|
||||||
indexerOutput.addFriendDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_FRIEND ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FWD_CLASS_CONST:
|
case FWD_CLASS_CONST:
|
||||||
indexerOutput.addFwd_ClassDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_FWD_CLASS ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FWD_STRUCT_CONST:
|
case FWD_STRUCT_CONST:
|
||||||
indexerOutput.addFwd_StructDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_FWD_STRUCT ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FWD_UNION_CONST:
|
case FWD_UNION_CONST:
|
||||||
indexerOutput.addFwd_UnionDecl(fileNumber, name, offset, length, offsetType);
|
typeEntry = new TypeEntry(IIndex.TYPE_FWD_UNION ,entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
typeEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
typeEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case NAMESPACE_CONST:
|
case NAMESPACE_CONST:
|
||||||
indexerOutput.addNamespaceDecl(fileNumber, name, offset, length, offsetType);
|
namedEntry = new NamedEntry(IIndex.NAMESPACE, entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
namedEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case ENUMERATOR_CONST:
|
case ENUMERATOR_CONST:
|
||||||
indexerOutput.addEnumtorDecl(fileNumber, name, offset, length, offsetType);
|
namedEntry = new NamedEntry(IIndex.ENUMTOR, entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
namedEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FIELD_CONST:
|
case FIELD_CONST:
|
||||||
indexerOutput.addFieldDecl(fileNumber, name, offset, length, offsetType);
|
namedEntry = new NamedEntry(IIndex.FIELD, entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
namedEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case METHOD_CONST:
|
case METHOD_CONST:
|
||||||
indexerOutput.addMethodDecl(fileNumber, name, offset, length, offsetType);
|
functionEntry = new FunctionEntry(IIndex.METHOD, entryKind,name,0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
functionEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case FUNCTION_CONST:
|
case FUNCTION_CONST:
|
||||||
indexerOutput.addFunctionDecl(fileNumber, name, offset, length, offsetType);
|
functionEntry = new FunctionEntry(IIndex.FUNCTION, entryKind,name,0 /*getModifiers()*/, fileNumber);
|
||||||
|
//funEntry.setSignature(getFunctionSignature());
|
||||||
|
functionEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
functionEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
case MACRO_CONST:
|
case MACRO_CONST:
|
||||||
indexerOutput.addMacroDecl(fileNumber, name, offset, length, offsetType);
|
namedEntry = new NamedEntry(IIndex.MACRO, entryKind, name, 0 /*getModifiers()*/, fileNumber);
|
||||||
|
namedEntry.setNameOffset(offset, length, offsetType);
|
||||||
|
namedEntry.serialize(indexerOutput);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addNameRef(IIndexerOutput indexerOutput,
|
|
||||||
char[][] name,
|
|
||||||
EntryType entryType,
|
|
||||||
int fileNumber,
|
|
||||||
int offset,
|
|
||||||
int length,
|
|
||||||
int offsetType) {
|
|
||||||
//TODO temporary until all bindings are completed
|
|
||||||
if (name == null)
|
|
||||||
name = new char[][] {"NPE".toCharArray()}; //$NON-NLS-1$
|
|
||||||
switch (entryType.toInt()) {
|
|
||||||
case CLASS_CONST:
|
|
||||||
indexerOutput.addClassRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case STRUCT_CONST:
|
|
||||||
indexerOutput.addStructRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case UNION_CONST:
|
|
||||||
indexerOutput.addUnionRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case ENUM_CONST:
|
|
||||||
indexerOutput.addEnumRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case VAR_CONST:
|
|
||||||
indexerOutput.addVariableRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case TYPEDEF_CONST:
|
|
||||||
indexerOutput.addTypedefRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case DERIVED_CONST:
|
|
||||||
indexerOutput.addDerivedRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FRIEND_CONST:
|
|
||||||
indexerOutput.addFriendRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FWD_CLASS_CONST:
|
|
||||||
indexerOutput.addFwd_ClassRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FWD_STRUCT_CONST:
|
|
||||||
indexerOutput.addFwd_StructRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FWD_UNION_CONST:
|
|
||||||
indexerOutput.addFwd_UnionRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case NAMESPACE_CONST:
|
|
||||||
indexerOutput.addNamespaceRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case ENUMERATOR_CONST:
|
|
||||||
indexerOutput.addEnumtorRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FIELD_CONST:
|
|
||||||
indexerOutput.addFieldRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case METHOD_CONST:
|
|
||||||
indexerOutput.addMethodRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case FUNCTION_CONST:
|
|
||||||
indexerOutput.addFunctionRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
case INCLUDE_CONST:
|
|
||||||
indexerOutput.addIncludeRef(fileNumber, name, offset, length, offsetType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue