mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-05 14:43:36 +02:00
Bindings for names resolved via using declarations, bug 219424.
This commit is contained in:
parent
b803bae59f
commit
270e8513e6
78 changed files with 418 additions and 1449 deletions
|
@ -87,7 +87,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
|
@ -1080,17 +1079,17 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
|
|
||||||
ICPPUsingDeclaration using = (ICPPUsingDeclaration) collector
|
ICPPUsingDeclaration using = (ICPPUsingDeclaration) collector
|
||||||
.getName(5).resolveBinding();
|
.getName(5).resolveBinding();
|
||||||
ICPPDelegate[] delegates = using.getDelegates();
|
IBinding[] delegates = using.getDelegates();
|
||||||
assertEquals(delegates.length, 1);
|
assertEquals(delegates.length, 1);
|
||||||
assertSame(delegates[0].getBinding(), f);
|
assertSame(delegates[0], f);
|
||||||
assertInstances(collector, delegates[0], 2);
|
assertInstances(collector, delegates[0], 3); // decl + using-decl + ref
|
||||||
assertInstances(collector, A, 2);
|
assertInstances(collector, A, 2);
|
||||||
assertInstances(collector, X, 3);
|
assertInstances(collector, X, 3);
|
||||||
|
|
||||||
ICPPUsingDeclaration using_g = (ICPPUsingDeclaration) collector
|
ICPPUsingDeclaration using_g = (ICPPUsingDeclaration) collector
|
||||||
.getName(8).resolveBinding();
|
.getName(8).resolveBinding();
|
||||||
assertSame(using_g.getDelegates()[0].getBinding(), g);
|
assertSame(using_g.getDelegates()[0], g);
|
||||||
assertInstances(collector, using_g.getDelegates()[0], 2);
|
assertInstances(collector, using_g.getDelegates()[0], 3); // decl + using-decl + ref
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFunctionDeclarations() throws Exception {
|
public void testFunctionDeclarations() throws Exception {
|
||||||
|
@ -1516,8 +1515,8 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
ICPPNamespace A = (ICPPNamespace) col.getName(0).resolveBinding();
|
ICPPNamespace A = (ICPPNamespace) col.getName(0).resolveBinding();
|
||||||
IVariable x = (IVariable) col.getName(1).resolveBinding();
|
IVariable x = (IVariable) col.getName(1).resolveBinding();
|
||||||
ICPPNamespace B = (ICPPNamespace) col.getName(2).resolveBinding();
|
ICPPNamespace B = (ICPPNamespace) col.getName(2).resolveBinding();
|
||||||
assertTrue(B instanceof ICPPDelegate);
|
assertTrue(B instanceof ICPPNamespaceAlias);
|
||||||
assertSame(((ICPPDelegate) B).getBinding(), A);
|
assertSame(((ICPPNamespaceAlias) B).getBinding(), A);
|
||||||
|
|
||||||
assertInstances(col, A, 2);
|
assertInstances(col, A, 2);
|
||||||
assertInstances(col, B, 2);
|
assertInstances(col, B, 2);
|
||||||
|
@ -2859,26 +2858,25 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
|
||||||
ICPPFunction f_ref = (ICPPFunction) col.getName(12).resolveBinding();
|
ICPPFunction f_ref = (ICPPFunction) col.getName(12).resolveBinding();
|
||||||
assertTrue(f_ref instanceof ICPPDelegate);
|
ICPPFunction g_ref = (ICPPFunction) col.getName(15).resolveBinding();
|
||||||
IFunction g_ref = (IFunction) col.getName(15).resolveBinding();
|
|
||||||
|
|
||||||
ICPPFunction f = (ICPPFunction) col.getName(1).resolveBinding();
|
ICPPFunction f = (ICPPFunction) col.getName(1).resolveBinding();
|
||||||
assertSame(((ICPPDelegate) f_ref).getBinding(), f);
|
assertSame(f_ref, f);
|
||||||
|
|
||||||
IFunction g = (IFunction) col.getName(13).resolveBinding();
|
IFunction g = (IFunction) col.getName(13).resolveBinding();
|
||||||
assertSame(g, g_ref);
|
assertSame(g, g_ref);
|
||||||
|
|
||||||
assertInstances(col, f_ref, 1);
|
assertInstances(col, f_ref, 2);
|
||||||
assertInstances(col, g_ref, 2);
|
assertInstances(col, g_ref, 2);
|
||||||
|
|
||||||
String[] s = f_ref.getQualifiedName();
|
String[] s = f_ref.getQualifiedName();
|
||||||
assertEquals(s[0], "D"); //$NON-NLS-1$
|
assertEquals(s[0], "B"); //$NON-NLS-1$
|
||||||
assertEquals(s[1], "f"); //$NON-NLS-1$
|
assertEquals(s[1], "f"); //$NON-NLS-1$
|
||||||
assertTrue(f_ref.isGloballyQualified());
|
assertTrue(f_ref.isGloballyQualified());
|
||||||
|
|
||||||
s = f.getQualifiedName();
|
s = g_ref.getQualifiedName();
|
||||||
assertEquals(s[0], "B"); //$NON-NLS-1$
|
assertEquals(s[0], "D"); //$NON-NLS-1$
|
||||||
assertEquals(s[1], "f"); //$NON-NLS-1$
|
assertEquals(s[1], "g"); //$NON-NLS-1$
|
||||||
assertTrue(f.isGloballyQualified());
|
assertTrue(f.isGloballyQualified());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2901,8 +2899,8 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
s = alias.getQualifiedName();
|
s = alias.getQualifiedName();
|
||||||
assertEquals(s[0], "CWVLN"); //$NON-NLS-1$
|
assertEquals(s[0], "CWVLN"); //$NON-NLS-1$
|
||||||
|
|
||||||
assertTrue(alias instanceof ICPPDelegate);
|
assertTrue(alias instanceof ICPPNamespaceAlias);
|
||||||
assertSame(((ICPPDelegate) alias).getBinding(), ns);
|
assertSame(((ICPPNamespaceAlias) alias).getBinding(), ns);
|
||||||
|
|
||||||
IASTName[] refs = tu.getReferences(ns);
|
IASTName[] refs = tu.getReferences(ns);
|
||||||
assertEquals(refs.length, 2);
|
assertEquals(refs.length, 2);
|
||||||
|
@ -2944,7 +2942,7 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertSame(decls[0], col.getName(1));
|
assertSame(decls[0], col.getName(1));
|
||||||
assertSame(decls[1], col.getName(3));
|
assertSame(decls[1], col.getName(3));
|
||||||
|
|
||||||
ICPPDelegate[] delegates = u.getDelegates();
|
IBinding[] delegates = u.getDelegates();
|
||||||
assertEquals(delegates.length, 2);
|
assertEquals(delegates.length, 2);
|
||||||
|
|
||||||
decls = tu.getDeclarationsInAST(delegates[0]);
|
decls = tu.getDeclarationsInAST(delegates[0]);
|
||||||
|
@ -2952,8 +2950,8 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertSame(decls[0], col.getName(1));
|
assertSame(decls[0], col.getName(1));
|
||||||
assertSame(decls[1], col.getName(7));
|
assertSame(decls[1], col.getName(7));
|
||||||
|
|
||||||
decls = tu.getDeclarationsInAST(delegates[0].getBinding());
|
decls = tu.getDeclarationsInAST(delegates[0]);
|
||||||
assertEquals(1, decls.length);
|
assertEquals(2, decls.length); // function-decl + using-decl
|
||||||
assertSame(decls[0], col.getName(1));
|
assertSame(decls[0], col.getName(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2980,8 +2978,7 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
|
|
||||||
IFunction f_decl = (IFunction) col.getName(10).resolveBinding();
|
IFunction f_decl = (IFunction) col.getName(10).resolveBinding();
|
||||||
IFunction f_ref = (IFunction) col.getName(19).resolveBinding();
|
IFunction f_ref = (IFunction) col.getName(19).resolveBinding();
|
||||||
assertTrue(f_ref instanceof ICPPDelegate);
|
assertSame(f_decl, f_ref);
|
||||||
assertSame(f_decl, ((ICPPDelegate) f_ref).getBinding());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBug86470_3() throws Exception {
|
public void testBug86470_3() throws Exception {
|
||||||
|
@ -3003,15 +3000,12 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
IBinding ref1 = col.getName(8).resolveBinding();
|
IBinding ref1 = col.getName(8).resolveBinding();
|
||||||
IBinding ref2 = col.getName(9).resolveBinding();
|
IBinding ref2 = col.getName(9).resolveBinding();
|
||||||
|
|
||||||
assertTrue(ref1 instanceof ICPPDelegate);
|
|
||||||
assertTrue(ref2 instanceof ICPPDelegate);
|
|
||||||
|
|
||||||
ICPPClassType g_struct = (ICPPClassType) col.getName(1)
|
ICPPClassType g_struct = (ICPPClassType) col.getName(1)
|
||||||
.resolveBinding();
|
.resolveBinding();
|
||||||
IFunction g_func = (IFunction) col.getName(2).resolveBinding();
|
IFunction g_func = (IFunction) col.getName(2).resolveBinding();
|
||||||
|
|
||||||
assertSame(g_struct, ((ICPPDelegate) ref2).getBinding());
|
assertSame(g_struct,ref2);
|
||||||
assertSame(g_func, ((ICPPDelegate) ref1).getBinding());
|
assertSame(g_func, ref1);
|
||||||
|
|
||||||
ICPPUsingDeclaration comp = (ICPPUsingDeclaration) col.getName(7)
|
ICPPUsingDeclaration comp = (ICPPUsingDeclaration) col.getName(7)
|
||||||
.resolveBinding();
|
.resolveBinding();
|
||||||
|
@ -3048,10 +3042,8 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
.resolveBinding();
|
.resolveBinding();
|
||||||
IVariable x_var = (IVariable) col.getName(1).resolveBinding();
|
IVariable x_var = (IVariable) col.getName(1).resolveBinding();
|
||||||
|
|
||||||
assertTrue(ref1 instanceof ICPPDelegate);
|
assertSame(x_struct, ref2);
|
||||||
assertTrue(ref2 instanceof ICPPDelegate);
|
assertSame(x_var, ref1);
|
||||||
assertSame(x_struct, ((ICPPDelegate) ref2).getBinding());
|
|
||||||
assertSame(x_var, ((ICPPDelegate) ref1).getBinding());
|
|
||||||
|
|
||||||
IASTName[] refs = tu.getReferences(x_struct);
|
IASTName[] refs = tu.getReferences(x_struct);
|
||||||
assertEquals(2, refs.length); // 1 ref + using-decl
|
assertEquals(2, refs.length); // 1 ref + using-decl
|
||||||
|
@ -3059,8 +3051,9 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertSame(refs[1], col.getName(12));
|
assertSame(refs[1], col.getName(12));
|
||||||
|
|
||||||
String[] s = ref2.getQualifiedName();
|
String[] s = ref2.getQualifiedName();
|
||||||
assertEquals(s[0], "x"); //$NON-NLS-1$
|
assertEquals(s[0], "B"); //$NON-NLS-1$
|
||||||
assertFalse(ref2.isGloballyQualified());
|
assertEquals(s[1], "x"); //$NON-NLS-1$
|
||||||
|
assertTrue(ref2.isGloballyQualified());
|
||||||
|
|
||||||
s = x_struct.getQualifiedName();
|
s = x_struct.getQualifiedName();
|
||||||
assertEquals(s[0], "B"); //$NON-NLS-1$
|
assertEquals(s[0], "B"); //$NON-NLS-1$
|
||||||
|
@ -3087,12 +3080,12 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
ICPPFunction f = (ICPPFunction) col.getName(3).resolveBinding();
|
ICPPFunction f = (ICPPFunction) col.getName(3).resolveBinding();
|
||||||
|
|
||||||
ICPPFunction f_ref = (ICPPFunction) col.getName(11).resolveBinding();
|
ICPPFunction f_ref = (ICPPFunction) col.getName(11).resolveBinding();
|
||||||
assertTrue(f_ref instanceof ICPPDelegate);
|
assertSame( f_ref, f);
|
||||||
assertSame(((ICPPDelegate) f_ref).getBinding(), f);
|
|
||||||
|
|
||||||
String[] s = f_ref.getQualifiedName();
|
String[] s = f_ref.getQualifiedName();
|
||||||
assertEquals(s[0], "f"); //$NON-NLS-1$
|
assertEquals(s[0], "A"); //$NON-NLS-1$
|
||||||
assertFalse(f_ref.isGloballyQualified());
|
assertEquals(s[1], "f"); //$NON-NLS-1$
|
||||||
|
assertTrue(f_ref.isGloballyQualified());
|
||||||
|
|
||||||
s = f.getQualifiedName();
|
s = f.getQualifiedName();
|
||||||
assertEquals(s[0], "A"); //$NON-NLS-1$
|
assertEquals(s[0], "A"); //$NON-NLS-1$
|
||||||
|
@ -3352,20 +3345,15 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
IBinding[] bs = scope.find("f"); //$NON-NLS-1$
|
IBinding[] bs = scope.find("f"); //$NON-NLS-1$
|
||||||
assertEquals(bs.length, 3);
|
assertEquals(bs.length, 3);
|
||||||
assertSame(bs[0], f3);
|
assertSame(bs[0], f3);
|
||||||
assertSame(((ICPPDelegate) bs[1]).getBinding(), f1);
|
assertSame( bs[1], f1);
|
||||||
assertSame(((ICPPDelegate) bs[2]).getBinding(), f2);
|
assertSame( bs[2], f2);
|
||||||
|
|
||||||
String[] s = ((ICPPDelegate) bs[1]).getQualifiedName();
|
|
||||||
assertEquals(s.length, 1);
|
|
||||||
assertEquals(s[0], "f"); //$NON-NLS-1$
|
|
||||||
assertFalse(((ICPPDelegate) bs[1]).isGloballyQualified());
|
|
||||||
|
|
||||||
s = ((ICPPBinding) ((ICPPDelegate) bs[1]).getBinding())
|
String[] s = ((ICPPBinding) bs[1]).getQualifiedName();
|
||||||
.getQualifiedName();
|
|
||||||
assertEquals(s.length, 2);
|
assertEquals(s.length, 2);
|
||||||
assertEquals(s[0], "A"); //$NON-NLS-1$
|
assertEquals(s[0], "A"); //$NON-NLS-1$
|
||||||
assertEquals(s[1], "f"); //$NON-NLS-1$
|
assertEquals(s[1], "f"); //$NON-NLS-1$
|
||||||
assertTrue(((ICPPBinding) ((ICPPDelegate) bs[1]).getBinding())
|
assertTrue(((ICPPBinding) bs[1])
|
||||||
.isGloballyQualified());
|
.isGloballyQualified());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5369,9 +5357,9 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
|
|
||||||
ICPPField i = (ICPPField) col.getName(1).resolveBinding();
|
ICPPField i = (ICPPField) col.getName(1).resolveBinding();
|
||||||
ICPPUsingDeclaration using = (ICPPUsingDeclaration) col.getName(6).resolveBinding();
|
ICPPUsingDeclaration using = (ICPPUsingDeclaration) col.getName(6).resolveBinding();
|
||||||
ICPPDelegate [] delegates = using.getDelegates();
|
IBinding[] delegates = using.getDelegates();
|
||||||
assertEquals( delegates.length, 1 );
|
assertEquals( delegates.length, 1 );
|
||||||
assertSame( i, delegates[0].getBinding() );
|
assertSame( i, delegates[0]);
|
||||||
|
|
||||||
assertSame( i, col.getName(16).resolveBinding() );
|
assertSame( i, col.getName(16).resolveBinding() );
|
||||||
}
|
}
|
||||||
|
@ -5627,18 +5615,18 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
// check class
|
// check class
|
||||||
IBinding b= cldef.getName().resolveBinding();
|
IBinding b= cldef.getName().resolveBinding();
|
||||||
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
||||||
assertEquals(1, tu.getDefinitionsInAST(b).length); // class-def
|
assertEquals(2, tu.getDefinitionsInAST(b).length); // class-def + using-decl
|
||||||
assertEquals(1, tu.getDeclarationsInAST(b).length); // class-def
|
assertEquals(2, tu.getDeclarationsInAST(b).length); // class-def + using-decl
|
||||||
|
|
||||||
// check functions
|
// check functions
|
||||||
b= fdecl1.getName().resolveBinding();
|
b= fdecl1.getName().resolveBinding();
|
||||||
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
||||||
assertEquals(0, tu.getDefinitionsInAST(b).length); // no def
|
assertEquals(1, tu.getDefinitionsInAST(b).length); // using-decl
|
||||||
assertEquals(1, tu.getDeclarationsInAST(b).length); // func-decl
|
assertEquals(2, tu.getDeclarationsInAST(b).length); // func-decl + using-decl
|
||||||
b= fdecl2.getName().resolveBinding();
|
b= fdecl2.getName().resolveBinding();
|
||||||
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
assertEquals(3, tu.getReferences(b).length); // 2 refs + using-decl
|
||||||
assertEquals(0, tu.getDefinitionsInAST(b).length); // no def
|
assertEquals(1, tu.getDefinitionsInAST(b).length); // using-decl
|
||||||
assertEquals(1, tu.getDeclarationsInAST(b).length); // func-decl
|
assertEquals(2, tu.getDeclarationsInAST(b).length); // func-decl + using-decl
|
||||||
|
|
||||||
// check using declaration class
|
// check using declaration class
|
||||||
b= udcl.getName().resolveBinding();
|
b= udcl.getName().resolveBinding();
|
||||||
|
@ -5734,7 +5722,7 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
// func(qualified);
|
// func(qualified);
|
||||||
// func(unqualified);
|
// func(unqualified);
|
||||||
// }
|
// }
|
||||||
public void _testScopeOfUsingDelegates_Bug219424() throws Exception {
|
public void testScopeOfUsingDelegates_Bug219424() throws Exception {
|
||||||
BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
|
BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
|
||||||
|
|
||||||
bh.assertNonProblem("cl c", 2);
|
bh.assertNonProblem("cl c", 2);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -11,9 +11,6 @@
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
/*
|
|
||||||
* Created on Mar 11, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.core.parser.tests.ast2;
|
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -47,7 +44,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
|
@ -1150,8 +1146,7 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
assertSame( ((ICPPTemplateInstance)A3).getTemplateDefinition(), A2 );
|
assertSame( ((ICPPTemplateInstance)A3).getTemplateDefinition(), A2 );
|
||||||
|
|
||||||
ICPPClassTemplate A4 = (ICPPClassTemplate) col.getName(14).resolveBinding();
|
ICPPClassTemplate A4 = (ICPPClassTemplate) col.getName(14).resolveBinding();
|
||||||
assertTrue( A4 instanceof ICPPDelegate );
|
assertSame( A4, A1 );
|
||||||
assertSame( ((ICPPDelegate)A4).getBinding(), A1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testTemplateTemplateParameter() throws Exception {
|
public void testTemplateTemplateParameter() throws Exception {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -55,7 +55,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
|
@ -106,6 +105,7 @@ public class CompleteParser2Tests extends BaseTestCase {
|
||||||
shouldVisitNames = true;
|
shouldVisitNames = true;
|
||||||
}
|
}
|
||||||
public List nameList = new ArrayList();
|
public List nameList = new ArrayList();
|
||||||
|
@Override
|
||||||
public int visit( IASTName name ){
|
public int visit( IASTName name ){
|
||||||
nameList.add( name );
|
nameList.add( name );
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
@ -122,6 +122,7 @@ public class CompleteParser2Tests extends BaseTestCase {
|
||||||
shouldVisitNames = true;
|
shouldVisitNames = true;
|
||||||
}
|
}
|
||||||
public List nameList = new ArrayList();
|
public List nameList = new ArrayList();
|
||||||
|
@Override
|
||||||
public int visit( IASTName name ){
|
public int visit( IASTName name ){
|
||||||
nameList.add( name );
|
nameList.add( name );
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
@ -414,10 +415,10 @@ public class CompleteParser2Tests extends BaseTestCase {
|
||||||
assertInstances( col, C, 2 );
|
assertInstances( col, C, 2 );
|
||||||
assertInstances( col, y, 1 );
|
assertInstances( col, y, 1 );
|
||||||
|
|
||||||
ICPPDelegate [] ds = using_x.getDelegates();
|
IBinding [] ds = using_x.getDelegates();
|
||||||
assertSame( ds[0].getBinding(), x );
|
assertSame( ds[0], x );
|
||||||
assertSame( using_C.getDelegates()[0].getBinding(), C );
|
assertSame( using_C.getDelegates()[0], C );
|
||||||
assertSame( using_y.getDelegates()[0].getBinding(), y );
|
assertSame( using_y.getDelegates()[0], y );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumerations() throws Exception
|
public void testEnumerations() throws Exception
|
||||||
|
@ -536,8 +537,8 @@ public class CompleteParser2Tests extends BaseTestCase {
|
||||||
assertInstances( col, A, 2 );
|
assertInstances( col, A, 2 );
|
||||||
assertInstances( col, bar, 1 );
|
assertInstances( col, bar, 1 );
|
||||||
|
|
||||||
assertSame( using_foo.getDelegates()[0].getBinding(), foo );
|
assertSame( using_foo.getDelegates()[0], foo );
|
||||||
assertSame( using_bar.getDelegates()[0].getBinding(), bar );
|
assertSame( using_bar.getDelegates()[0], bar );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLinkageSpec() throws Exception
|
public void testLinkageSpec() throws Exception
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
|
@ -700,14 +699,12 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// }
|
// }
|
||||||
public void testAdvanceUsingDeclaration_Bug217102() throws Exception {
|
public void testAdvanceUsingDeclaration_Bug217102() throws Exception {
|
||||||
IBinding cl = getBindingFromASTName("Bar* Foo", 3);
|
IBinding cl = getBindingFromASTName("Bar* Foo", 3);
|
||||||
assertTrue(cl instanceof ICPPDelegate);
|
|
||||||
cl= ((ICPPDelegate) cl).getBinding();
|
|
||||||
assertEquals("Bar", cl.getName());
|
assertEquals("Bar", cl.getName());
|
||||||
assertTrue(cl instanceof ICPPClassType);
|
assertTrue(cl instanceof ICPPClassType);
|
||||||
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
||||||
|
|
||||||
cl = getBindingFromASTName("Bar* pBar", 3);
|
cl = getBindingFromASTName("Bar* pBar", 3);
|
||||||
cl= ((ICPPDelegate) cl).getBinding();
|
|
||||||
assertEquals("Bar", cl.getName());
|
assertEquals("Bar", cl.getName());
|
||||||
assertTrue(cl instanceof ICPPClassType);
|
assertTrue(cl instanceof ICPPClassType);
|
||||||
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||||
|
@ -69,12 +68,6 @@ public class CElementHandleFactory {
|
||||||
|
|
||||||
public static ICElementHandle internalCreate(ITranslationUnit tu, IBinding binding, boolean definition,
|
public static ICElementHandle internalCreate(ITranslationUnit tu, IBinding binding, boolean definition,
|
||||||
IRegion region, long timestamp) throws CoreException, DOMException {
|
IRegion region, long timestamp) throws CoreException, DOMException {
|
||||||
if (binding instanceof ICPPDelegate) {
|
|
||||||
ICPPDelegate delegate= (ICPPDelegate) binding;
|
|
||||||
if (delegate.getDelegateType() == ICPPDelegate.USING_DECLARATION) {
|
|
||||||
binding= delegate.getBinding();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ICElement parentElement= create(tu, binding.getScope());
|
ICElement parentElement= create(tu, binding.getScope());
|
||||||
if (parentElement == null) {
|
if (parentElement == null) {
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* IBM Corporation - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Created on Mar 15, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ICPPDelegate is meant to represent IBindings that are identical in most
|
|
||||||
* ways to another binding. Namespace aliases and using declarations will both
|
|
||||||
* be represented by delegates
|
|
||||||
*
|
|
||||||
* @author aniefer
|
|
||||||
*/
|
|
||||||
public interface ICPPDelegate extends ICPPBinding, Cloneable {
|
|
||||||
/**
|
|
||||||
* Kinds of things delegates can represent
|
|
||||||
*/
|
|
||||||
public static final int NAMESPACE_ALIAS = 1;
|
|
||||||
public static final int USING_DECLARATION = 2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What type of delegate is this?
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public int getDelegateType();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the original binding that we are a delegate of
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public IBinding getBinding();
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005 IBM Corporation and others.
|
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,14 +8,18 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
/*
|
|
||||||
* Created on Mar 17, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public interface ICPPNamespaceAlias extends ICPPNamespace, ICPPDelegate {
|
public interface ICPPNamespaceAlias extends ICPPNamespace {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the binding of the original namespace.
|
||||||
|
*/
|
||||||
|
public IBinding getBinding();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,13 +8,9 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*
|
|
||||||
* Created on Mar 16, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A using declaration introduces a name into the declarative region in which
|
* A using declaration introduces a name into the declarative region in which
|
||||||
|
@ -31,5 +27,5 @@ public interface ICPPUsingDeclaration extends ICPPBinding {
|
||||||
* is a reference.
|
* is a reference.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ICPPDelegate [] getDelegates() throws DOMException;
|
IBinding[] getDelegates();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,12 +22,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
@ -159,18 +157,12 @@ public class CPPClassInstance extends CPPInstance implements ICPPClassType, ICPP
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#clone()
|
* @see java.lang.Object#clone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object clone(){
|
public Object clone(){
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassType.CPPClassTypeDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
||||||
*/
|
*/
|
||||||
|
@ -216,6 +208,7 @@ public class CPPClassInstance extends CPPInstance implements ICPPClassType, ICPP
|
||||||
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
return obj instanceof ICPPClassType ? isSameType((ICPPClassType)obj) : false;
|
return obj instanceof ICPPClassType ? isSameType((ICPPClassType)obj) : false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
|
@ -242,13 +240,7 @@ public class CPPClassSpecialization extends CPPSpecialization implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassType.CPPClassTypeDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -37,12 +37,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
|
@ -55,40 +52,6 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate,
|
ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate,
|
||||||
ICPPInternalClassTypeMixinHost {
|
ICPPInternalClassTypeMixinHost {
|
||||||
|
|
||||||
public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate
|
|
||||||
implements ICPPClassTemplate, ICPPInternalClassTemplate {
|
|
||||||
public CPPClassTemplateDelegate(ICPPUsingDeclaration usingDecl, ICPPClassType cls) {
|
|
||||||
super(usingDecl, cls);
|
|
||||||
}
|
|
||||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() throws DOMException {
|
|
||||||
return ((ICPPClassTemplate)getBinding()).getPartialSpecializations();
|
|
||||||
}
|
|
||||||
public ICPPTemplateParameter[] getTemplateParameters() throws DOMException {
|
|
||||||
return ((ICPPClassTemplate)getBinding()).getTemplateParameters();
|
|
||||||
}
|
|
||||||
public void addSpecialization(IType[] arguments, ICPPSpecialization specialization) {
|
|
||||||
final IBinding binding = getBinding();
|
|
||||||
if (binding instanceof ICPPInternalBinding) {
|
|
||||||
((ICPPInternalTemplate)binding).addSpecialization(arguments, specialization);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public IBinding instantiate(IType[] arguments) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).instantiate(arguments);
|
|
||||||
}
|
|
||||||
public ICPPSpecialization deferredInstance(IType[] arguments) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).deferredInstance(arguments);
|
|
||||||
}
|
|
||||||
public ICPPSpecialization getInstance(IType[] arguments) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).getInstance(arguments);
|
|
||||||
}
|
|
||||||
public void addPartialSpecialization(ICPPClassTemplatePartialSpecialization spec) {
|
|
||||||
final IBinding binding = getBinding();
|
|
||||||
if (binding instanceof ICPPInternalClassTemplate) {
|
|
||||||
((ICPPInternalClassTemplate)getBinding()).addPartialSpecialization(spec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class FindDefinitionAction extends CPPASTVisitor {
|
private class FindDefinitionAction extends CPPASTVisitor {
|
||||||
private char[] nameArray = CPPClassTemplate.this.getNameCharArray();
|
private char[] nameArray = CPPClassTemplate.this.getNameCharArray();
|
||||||
public IASTName result = null;
|
public IASTName result = null;
|
||||||
|
@ -100,6 +63,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTName name) {
|
public int visit(IASTName name) {
|
||||||
if (name instanceof ICPPASTTemplateId || name instanceof ICPPASTQualifiedName)
|
if (name instanceof ICPPASTTemplateId || name instanceof ICPPASTQualifiedName)
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
@ -128,14 +92,17 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
if (declaration instanceof IASTSimpleDeclaration || declaration instanceof ICPPASTTemplateDeclaration)
|
if (declaration instanceof IASTSimpleDeclaration || declaration instanceof ICPPASTTemplateDeclaration)
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclSpecifier declSpec) {
|
public int visit(IASTDeclSpecifier declSpec) {
|
||||||
return (declSpec instanceof ICPPASTCompositeTypeSpecifier) ? PROCESS_CONTINUE : PROCESS_SKIP;
|
return (declSpec instanceof ICPPASTCompositeTypeSpecifier) ? PROCESS_CONTINUE : PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) { return PROCESS_SKIP; }
|
public int visit(IASTDeclarator declarator) { return PROCESS_SKIP; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +114,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
this.mixin= new ClassTypeMixin(this);
|
this.mixin= new ClassTypeMixin(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICPPSpecialization deferredInstance(IType[] arguments) {
|
public ICPPSpecialization deferredInstance(IType[] arguments) {
|
||||||
ICPPSpecialization instance = getInstance(arguments);
|
ICPPSpecialization instance = getInstance(arguments);
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
|
@ -230,14 +198,10 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
return partialSpecializations;
|
return partialSpecializations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassTemplateDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if (type == this)
|
if (type == this)
|
||||||
return true;
|
return true;
|
||||||
if (type instanceof ITypedef || type instanceof IIndexType || type instanceof ICPPDelegate)
|
if (type instanceof ITypedef || type instanceof IIndexType)
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -286,6 +250,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
return mixin.findField(name);
|
return mixin.findField(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
try {
|
try {
|
||||||
return super.clone();
|
return super.clone();
|
||||||
|
@ -297,6 +262,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* For debug purposes only
|
* For debug purposes only
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ASTTypeUtil.getType(this);
|
return ASTTypeUtil.getType(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
|
@ -59,56 +57,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPClassType extends PlatformObject implements ICPPInternalClassTypeMixinHost, ICPPClassType, ICPPInternalClassType {
|
public class CPPClassType extends PlatformObject implements ICPPInternalClassTypeMixinHost, ICPPClassType, ICPPInternalClassType {
|
||||||
public static class CPPClassTypeDelegate extends CPPDelegate implements ICPPClassType {
|
|
||||||
public CPPClassTypeDelegate( ICPPUsingDeclaration usingDecl, ICPPClassType cls ){
|
|
||||||
super( usingDecl, cls );
|
|
||||||
}
|
|
||||||
public ICPPBase[] getBases() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getBases();
|
|
||||||
}
|
|
||||||
public IField[] getFields() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getFields();
|
|
||||||
}
|
|
||||||
public IField findField( String name ) throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).findField( name );
|
|
||||||
}
|
|
||||||
public ICPPField[] getDeclaredFields() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getDeclaredFields();
|
|
||||||
}
|
|
||||||
public ICPPMethod[] getMethods() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getMethods();
|
|
||||||
}
|
|
||||||
public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getAllDeclaredMethods();
|
|
||||||
}
|
|
||||||
public ICPPMethod[] getDeclaredMethods() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getDeclaredMethods();
|
|
||||||
}
|
|
||||||
public ICPPConstructor[] getConstructors() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getConstructors();
|
|
||||||
}
|
|
||||||
public IBinding[] getFriends() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getFriends();
|
|
||||||
}
|
|
||||||
public int getKey() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getKey();
|
|
||||||
}
|
|
||||||
public IScope getCompositeScope() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getCompositeScope();
|
|
||||||
}
|
|
||||||
public ICPPMethod[] getConversionOperators() throws DOMException {
|
|
||||||
IBinding binding = getBinding();
|
|
||||||
if( binding instanceof ICPPInternalClassType )
|
|
||||||
return ((ICPPInternalClassType)binding).getConversionOperators();
|
|
||||||
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
|
||||||
}
|
|
||||||
public boolean isSameType( IType type ) {
|
|
||||||
return ((ICPPClassType)getBinding()).isSameType( type );
|
|
||||||
}
|
|
||||||
public ICPPClassType[] getNestedClasses() throws DOMException {
|
|
||||||
return ((ICPPClassType)getBinding()).getNestedClasses();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class CPPClassTypeProblem extends ProblemBinding implements ICPPClassType{
|
public static class CPPClassTypeProblem extends ProblemBinding implements ICPPClassType{
|
||||||
public CPPClassTypeProblem( IASTNode node, int id, char[] arg ) {
|
public CPPClassTypeProblem( IASTNode node, int id, char[] arg ) {
|
||||||
super( node, id, arg );
|
super( node, id, arg );
|
||||||
|
@ -144,9 +92,11 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
public IScope getCompositeScope() throws DOMException {
|
public IScope getCompositeScope() throws DOMException {
|
||||||
throw new DOMException( this );
|
throw new DOMException( this );
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IScope getParent() throws DOMException {
|
public IScope getParent() throws DOMException {
|
||||||
throw new DOMException( this );
|
throw new DOMException( this );
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IBinding[] find(String name) throws DOMException {
|
public IBinding[] find(String name) throws DOMException {
|
||||||
throw new DOMException( this );
|
throw new DOMException( this );
|
||||||
}
|
}
|
||||||
|
@ -178,6 +128,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( IASTName name ){
|
public int visit( IASTName name ){
|
||||||
if( name instanceof ICPPASTTemplateId )
|
if( name instanceof ICPPASTTemplateId )
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
|
@ -208,14 +159,17 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( IASTDeclaration declaration ){
|
public int visit( IASTDeclaration declaration ){
|
||||||
if(declaration instanceof IASTSimpleDeclaration || declaration instanceof ICPPASTTemplateDeclaration)
|
if(declaration instanceof IASTSimpleDeclaration || declaration instanceof ICPPASTTemplateDeclaration)
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit( IASTDeclSpecifier declSpec ){
|
public int visit( IASTDeclSpecifier declSpec ){
|
||||||
return (declSpec instanceof ICPPASTCompositeTypeSpecifier ) ? PROCESS_CONTINUE : PROCESS_SKIP;
|
return (declSpec instanceof ICPPASTCompositeTypeSpecifier ) ? PROCESS_CONTINUE : PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit( IASTDeclarator declarator ) { return PROCESS_SKIP; }
|
public int visit( IASTDeclarator declarator ) { return PROCESS_SKIP; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,11 +358,6 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPClassTypeDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return Linkage.CPP_LINKAGE;
|
return Linkage.CPP_LINKAGE;
|
||||||
}
|
}
|
||||||
|
@ -418,7 +367,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
public boolean isSameType( IType type ) {
|
public boolean isSameType( IType type ) {
|
||||||
if (type == this)
|
if (type == this)
|
||||||
return true;
|
return true;
|
||||||
if (type instanceof ITypedef || type instanceof IIndexType || type instanceof ICPPDelegate)
|
if (type instanceof ITypedef || type instanceof IIndexType)
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -467,6 +416,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
|
||||||
return mixin.findField(name);
|
return mixin.findField(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
try {
|
try {
|
||||||
return super.clone();
|
return super.clone();
|
||||||
|
|
|
@ -20,11 +20,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,14 +105,6 @@ public class CPPDeferredClassInstance extends CPPInstance implements
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
|
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
|
||||||
*/
|
*/
|
||||||
|
@ -132,6 +122,7 @@ public class CPPDeferredClassInstance extends CPPInstance implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#clone()
|
* @see java.lang.Object#clone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,11 @@ import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
|
||||||
|
@ -68,6 +66,7 @@ public class CPPDeferredFunctionInstance extends CPPInstance implements ICPPFunc
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance#getArguments()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance#getArguments()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IType[] getArguments() {
|
public IType[] getArguments() {
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
@ -168,14 +167,6 @@ public class CPPDeferredFunctionInstance extends CPPInstance implements ICPPFunc
|
||||||
return ((ICPPFunction)getTemplateDefinition()).takesVarArgs();
|
return ((ICPPFunction)getTemplateDefinition()).takesVarArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction#isStatic(boolean)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction#isStatic(boolean)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,163 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* IBM Corporation - initial API and implementation
|
|
||||||
* Markus Schorn (Wind River Systems)
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ILinkage;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author aniefer
|
|
||||||
*/
|
|
||||||
public class CPPDelegate extends PlatformObject implements ICPPDelegate, ICPPInternalBinding {
|
|
||||||
private final IBinding originalBinding;
|
|
||||||
private ICPPUsingDeclaration usingDeclaration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CPPDelegate(ICPPUsingDeclaration usingDecl, IBinding original ) {
|
|
||||||
this.originalBinding = original;
|
|
||||||
this.usingDeclaration = usingDecl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getDelegateType()
|
|
||||||
*/
|
|
||||||
public int getDelegateType() {
|
|
||||||
return USING_DECLARATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding()
|
|
||||||
*/
|
|
||||||
public IBinding getBinding() {
|
|
||||||
return originalBinding;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#getQualifiedName()
|
|
||||||
*/
|
|
||||||
public String[] getQualifiedName() {
|
|
||||||
return CPPVisitor.getQualifiedName( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#getQualifiedNameCharArray()
|
|
||||||
*/
|
|
||||||
public char[][] getQualifiedNameCharArray() {
|
|
||||||
return CPPVisitor.getQualifiedNameCharArray( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#isGloballyQualified()
|
|
||||||
*/
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
|
||||||
IScope scope = getScope();
|
|
||||||
while( scope != null ){
|
|
||||||
if( scope instanceof ICPPBlockScope )
|
|
||||||
return false;
|
|
||||||
scope = scope.getParent();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
|
||||||
*/
|
|
||||||
public String getName() {
|
|
||||||
return usingDeclaration.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
|
||||||
*/
|
|
||||||
public char[] getNameCharArray() {
|
|
||||||
return usingDeclaration.getNameCharArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
|
|
||||||
*/
|
|
||||||
public IScope getScope() throws DOMException {
|
|
||||||
return usingDeclaration.getScope();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDeclarations()
|
|
||||||
*/
|
|
||||||
public IASTNode[] getDeclarations() {
|
|
||||||
if (usingDeclaration instanceof ICPPInternalBinding) {
|
|
||||||
return ((ICPPInternalBinding) usingDeclaration).getDeclarations();
|
|
||||||
}
|
|
||||||
return IASTNode.EMPTY_NODE_ARRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#getDefinition()
|
|
||||||
*/
|
|
||||||
public IASTNode getDefinition() {
|
|
||||||
if (usingDeclaration instanceof ICPPInternalBinding) {
|
|
||||||
return ((ICPPInternalBinding) usingDeclaration).getDefinition();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate( ICPPUsingDeclaration decl ) {
|
|
||||||
CPPDelegate delegate= (CPPDelegate) clone();
|
|
||||||
delegate.usingDeclaration= decl;
|
|
||||||
return delegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object clone() {
|
|
||||||
try {
|
|
||||||
return super.clone();
|
|
||||||
} catch (CloneNotSupportedException e) {
|
|
||||||
// cannot be thrown because we implement Clonable
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
|
||||||
*/
|
|
||||||
public void addDefinition(IASTNode node) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
|
||||||
*/
|
|
||||||
public void addDeclaration(IASTNode node) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeDeclaration(IASTNode node) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public ILinkage getLinkage() {
|
|
||||||
return Linkage.CPP_LINKAGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICPPUsingDeclaration getUsingDeclaration() {
|
|
||||||
return usingDeclaration;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -23,8 +23,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
@ -33,17 +31,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPPInternalBinding {
|
public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPPInternalBinding {
|
||||||
public static class CPPEnumerationDelegate extends CPPDelegate implements IEnumeration {
|
|
||||||
public CPPEnumerationDelegate( ICPPUsingDeclaration name, IEnumeration binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public IEnumerator[] getEnumerators() throws DOMException {
|
|
||||||
return ((IEnumeration)getBinding()).getEnumerators();
|
|
||||||
}
|
|
||||||
public boolean isSameType( IType type ) {
|
|
||||||
return ((IEnumeration)getBinding()).isSameType( type );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private IASTName enumName;
|
private IASTName enumName;
|
||||||
/**
|
/**
|
||||||
* @param specifier
|
* @param specifier
|
||||||
|
@ -95,6 +82,7 @@ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPP
|
||||||
return enumName;
|
return enumName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone(){
|
public Object clone(){
|
||||||
IType t = null;
|
IType t = null;
|
||||||
try {
|
try {
|
||||||
|
@ -145,13 +133,6 @@ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPP
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPEnumerationDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@ -178,7 +159,7 @@ public class CPPEnumeration extends PlatformObject implements IEnumeration, ICPP
|
||||||
public boolean isSameType( IType type ) {
|
public boolean isSameType( IType type ) {
|
||||||
if( type == this )
|
if( type == this )
|
||||||
return true;
|
return true;
|
||||||
if( type instanceof ITypedef || type instanceof IIndexType || type instanceof ICPPDelegate)
|
if( type instanceof ITypedef || type instanceof IIndexType)
|
||||||
return type.isSameType( this );
|
return type.isSameType( this );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
|
@ -30,14 +28,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPInternalBinding {
|
public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPInternalBinding {
|
||||||
public static class CPPEnumeratorDelegate extends CPPDelegate implements IEnumerator {
|
|
||||||
public CPPEnumeratorDelegate( ICPPUsingDeclaration name, IEnumerator binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public IType getType() throws DOMException {
|
|
||||||
return ((IEnumerator)getBinding()).getType();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IASTName enumName;
|
private IASTName enumName;
|
||||||
/**
|
/**
|
||||||
|
@ -128,13 +118,6 @@ public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPIn
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPEnumeratorDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,9 +25,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
|
||||||
|
@ -35,20 +33,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBinding {
|
public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBinding {
|
||||||
public static class CPPFieldDelegate extends CPPVariable.CPPVariableDelegate implements ICPPField {
|
|
||||||
public CPPFieldDelegate( ICPPUsingDeclaration name, ICPPField binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public int getVisibility() throws DOMException {
|
|
||||||
return ((ICPPField)getBinding()).getVisibility();
|
|
||||||
}
|
|
||||||
public ICPPClassType getClassOwner() throws DOMException {
|
|
||||||
return ((ICPPField)getBinding()).getClassOwner();
|
|
||||||
}
|
|
||||||
public ICompositeType getCompositeTypeOwner() throws DOMException {
|
|
||||||
return getClassOwner();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class CPPFieldProblem extends CPPVariable.CPPVariableProblem implements ICPPField {
|
public static class CPPFieldProblem extends CPPVariable.CPPVariableProblem implements ICPPField {
|
||||||
/**
|
/**
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -160,22 +144,17 @@ public class CPPField extends CPPVariable implements ICPPField, ICPPInternalBind
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable#isMutable()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable#isMutable()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isMutable() {
|
public boolean isMutable() {
|
||||||
return hasStorageClass( ICPPASTDeclSpecifier.sc_mutable);
|
return hasStorageClass( ICPPASTDeclSpecifier.sc_mutable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isExtern() {
|
public boolean isExtern() {
|
||||||
//7.1.1-5 The extern specifier can not be used in the declaration of class members
|
//7.1.1-5 The extern specifier can not be used in the declaration of class members
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPFieldDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICompositeType getCompositeTypeOwner() throws DOMException {
|
public ICompositeType getCompositeTypeOwner() throws DOMException {
|
||||||
return getClassOwner();
|
return getClassOwner();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,9 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField.CPPFieldDelegate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -80,10 +77,6 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFieldDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICompositeType getCompositeTypeOwner() throws DOMException {
|
public ICompositeType getCompositeTypeOwner() throws DOMException {
|
||||||
return getClassOwner();
|
return getClassOwner();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IFunction;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||||
|
@ -34,9 +33,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
@ -49,59 +46,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
*/
|
*/
|
||||||
public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInternalFunction {
|
public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInternalFunction {
|
||||||
|
|
||||||
public static class CPPFunctionDelegate extends CPPDelegate implements ICPPFunction, ICPPInternalFunction {
|
|
||||||
public CPPFunctionDelegate( ICPPUsingDeclaration usingDecl, ICPPFunction binding ) {
|
|
||||||
super( usingDecl, binding );
|
|
||||||
}
|
|
||||||
|
|
||||||
public IParameter[] getParameters() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).getParameters();
|
|
||||||
}
|
|
||||||
public IScope getFunctionScope() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).getFunctionScope();
|
|
||||||
}
|
|
||||||
public IFunctionType getType() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).getType();
|
|
||||||
}
|
|
||||||
public boolean isStatic() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isStatic();
|
|
||||||
}
|
|
||||||
public boolean isMutable() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isMutable();
|
|
||||||
}
|
|
||||||
public boolean isInline() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isInline();
|
|
||||||
}
|
|
||||||
public boolean isExternC() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isExternC();
|
|
||||||
}
|
|
||||||
public boolean isExtern() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isExtern();
|
|
||||||
}
|
|
||||||
public boolean isAuto() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isAuto();
|
|
||||||
}
|
|
||||||
public boolean isRegister() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).isRegister();
|
|
||||||
}
|
|
||||||
public boolean takesVarArgs() throws DOMException {
|
|
||||||
return ((ICPPFunction)getBinding()).takesVarArgs();
|
|
||||||
}
|
|
||||||
public boolean isStatic( boolean resolveAll) {
|
|
||||||
try {
|
|
||||||
return ASTInternal.isStatic((IFunction) getBinding(), resolveAll);
|
|
||||||
} catch (DOMException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public IBinding resolveParameter( IASTParameterDeclaration param ) {
|
|
||||||
final IBinding binding = getBinding();
|
|
||||||
if (binding instanceof ICPPInternalFunction) {
|
|
||||||
return ((ICPPInternalFunction)binding).resolveParameter( param );
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class CPPFunctionProblem extends ProblemBinding implements ICPPFunction {
|
public static class CPPFunctionProblem extends ProblemBinding implements ICPPFunction {
|
||||||
public CPPFunctionProblem( IASTNode node, int id, char[] arg ) {
|
public CPPFunctionProblem( IASTNode node, int id, char[] arg ) {
|
||||||
super( node, id, arg );
|
super( node, id, arg );
|
||||||
|
@ -507,13 +451,6 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPFunctionDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
static public boolean hasStorageClass( ICPPInternalFunction function, int storage){
|
static public boolean hasStorageClass( ICPPInternalFunction function, int storage){
|
||||||
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) function.getDefinition();
|
ICPPASTFunctionDeclarator dtor = (ICPPASTFunctionDeclarator) function.getDefinition();
|
||||||
IASTNode[] ds = function.getDeclarations();
|
IASTNode[] ds = function.getDeclarations();
|
||||||
|
|
|
@ -19,13 +19,11 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
|
||||||
|
@ -45,13 +43,6 @@ public class CPPFunctionInstance extends CPPInstance implements ICPPFunction, IC
|
||||||
super(scope, orig, argMap, args);
|
super(scope, orig, argMap, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunction.CPPFunctionDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IFunction#getParameters()
|
* @see org.eclipse.cdt.core.dom.ast.IFunction#getParameters()
|
||||||
*/
|
*/
|
||||||
|
@ -161,6 +152,7 @@ public class CPPFunctionInstance extends CPPInstance implements ICPPFunction, IC
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if( (obj instanceof ICPPTemplateInstance) && (obj instanceof ICPPFunction)){
|
if( (obj instanceof ICPPTemplateInstance) && (obj instanceof ICPPFunction)){
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -24,14 +24,11 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.CPPFunctionDelegate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -154,10 +151,6 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunctionDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction#resolveParameter(org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction#resolveParameter(org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration)
|
||||||
*/
|
*/
|
||||||
|
@ -193,6 +186,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
IASTNode n = node;
|
IASTNode n = node;
|
||||||
while( n instanceof IASTName )
|
while( n instanceof IASTName )
|
||||||
|
@ -202,6 +196,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
|
||||||
updateParameterBindings( (ICPPASTFunctionDeclarator) n );
|
updateParameterBindings( (ICPPASTFunctionDeclarator) n );
|
||||||
super.addDefinition( n );
|
super.addDefinition( n );
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
IASTNode n = node;
|
IASTNode n = node;
|
||||||
while( n instanceof IASTName )
|
while( n instanceof IASTName )
|
||||||
|
|
|
@ -29,12 +29,10 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,29 +92,6 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
||||||
throw new DOMException( this );
|
throw new DOMException( this );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static class CPPFunctionTemplateDelegate extends CPPFunction.CPPFunctionDelegate implements ICPPFunctionTemplate, ICPPInternalTemplate {
|
|
||||||
public CPPFunctionTemplateDelegate( ICPPUsingDeclaration name, ICPPFunction binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public ICPPTemplateParameter[] getTemplateParameters() throws DOMException {
|
|
||||||
return ((ICPPFunctionTemplate)getBinding()).getTemplateParameters();
|
|
||||||
}
|
|
||||||
public void addSpecialization( IType[] arguments, ICPPSpecialization specialization ) {
|
|
||||||
final IBinding binding = getBinding();
|
|
||||||
if (binding instanceof ICPPInternalBinding) {
|
|
||||||
((ICPPInternalTemplate)getBinding()).addSpecialization( arguments, specialization );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public IBinding instantiate( IType[] arguments ) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).instantiate( arguments );
|
|
||||||
}
|
|
||||||
public ICPPSpecialization deferredInstance( IType[] arguments ) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).deferredInstance( arguments );
|
|
||||||
}
|
|
||||||
public ICPPSpecialization getInstance( IType[] arguments ) {
|
|
||||||
return ((ICPPInternalTemplateInstantiator)getBinding()).getInstance( arguments );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IFunctionType type = null;
|
protected IFunctionType type = null;
|
||||||
/**
|
/**
|
||||||
|
@ -126,6 +101,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
if( !(node instanceof IASTName) )
|
if( !(node instanceof IASTName) )
|
||||||
return;
|
return;
|
||||||
|
@ -136,6 +112,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
if( !(node instanceof IASTName) )
|
if( !(node instanceof IASTName) )
|
||||||
return;
|
return;
|
||||||
|
@ -300,6 +277,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition#deferredInstance(org.eclipse.cdt.core.dom.ast.IType[])
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateDefinition#deferredInstance(org.eclipse.cdt.core.dom.ast.IType[])
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPSpecialization deferredInstance(IType[] arguments) {
|
public ICPPSpecialization deferredInstance(IType[] arguments) {
|
||||||
ICPPSpecialization instance = getInstance( arguments );
|
ICPPSpecialization instance = getInstance( arguments );
|
||||||
if( instance == null ){
|
if( instance == null ){
|
||||||
|
@ -424,12 +402,4 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition implements ICPPFu
|
||||||
public boolean isStatic( boolean resolveAll ) {
|
public boolean isStatic( boolean resolveAll ) {
|
||||||
return hasStorageClass( IASTDeclSpecifier.sc_static );
|
return hasStorageClass( IASTDeclSpecifier.sc_static );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPFunctionTemplateDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,11 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,11 +38,6 @@ public class CPPFunctionTemplateSpecialization extends CPPFunctionSpecialization
|
||||||
return template.getTemplateParameters();
|
return template.getTemplateParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addSpecialization(IType[] arguments, ICPPSpecialization specialization) {
|
public void addSpecialization(IType[] arguments, ICPPSpecialization specialization) {
|
||||||
if( instances == null )
|
if( instances == null )
|
||||||
instances = new ObjectMap(2);
|
instances = new ObjectMap(2);
|
||||||
|
|
|
@ -15,8 +15,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CPPImplicitTypedef is used to represent implicit typedefs that exist on the translation
|
* The CPPImplicitTypedef is used to represent implicit typedefs that exist on the translation
|
||||||
|
@ -41,6 +39,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.ITypedef#getType()
|
* @see org.eclipse.cdt.core.dom.ast.ITypedef#getType()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IType getType() {
|
public IType getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +47,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return String.valueOf(name);
|
return String.valueOf(name);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -62,6 +63,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +71,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType t) {
|
public boolean isSameType(IType t) {
|
||||||
if( t == this )
|
if( t == this )
|
||||||
return true;
|
return true;
|
||||||
|
@ -91,6 +94,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#clone()
|
* @see java.lang.Object#clone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object clone(){
|
public Object clone(){
|
||||||
IType t = null;
|
IType t = null;
|
||||||
t = (IType) super.clone();
|
t = (IType) super.clone();
|
||||||
|
@ -100,6 +104,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/**
|
/**
|
||||||
* returns null
|
* returns null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTNode[] getDeclarations() {
|
public IASTNode[] getDeclarations() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -107,20 +112,15 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/**
|
/**
|
||||||
* returns null
|
* returns null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTNode getDefinition() {
|
public IASTNode getDefinition() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPTypedefDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* does nothing
|
* does nothing
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/**
|
/**
|
||||||
* does nothing
|
* does nothing
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -135,6 +136,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/**
|
/**
|
||||||
* does nothing
|
* does nothing
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void removeDeclaration(IASTNode node) {
|
public void removeDeclaration(IASTNode node) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -142,6 +144,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedName()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedName()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getQualifiedName() {
|
public String[] getQualifiedName() {
|
||||||
String[] temp = new String[1];
|
String[] temp = new String[1];
|
||||||
temp[0] = String.valueOf(name);
|
temp[0] = String.valueOf(name);
|
||||||
|
@ -152,6 +155,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedNameCharArray()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedNameCharArray()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public char[][] getQualifiedNameCharArray() {
|
public char[][] getQualifiedNameCharArray() {
|
||||||
char[][] temp = new char[1][];
|
char[][] temp = new char[1][];
|
||||||
temp[0] = name;
|
temp[0] = name;
|
||||||
|
@ -162,6 +166,7 @@ public class CPPImplicitTypedef extends CPPTypedef implements ITypedef, ICPPInte
|
||||||
/**
|
/**
|
||||||
* returns true
|
* returns true
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isGloballyQualified() {
|
public boolean isGloballyQualified() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,6 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.ILabel;
|
import org.eclipse.cdt.core.dom.ast.ILabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
|
@ -116,14 +114,6 @@ public class CPPLabel extends PlatformObject implements ILabel, ICPPInternalBind
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,9 +28,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisiblityLabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
|
||||||
|
@ -38,35 +36,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPMethod extends CPPFunction implements ICPPMethod {
|
public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
public static class CPPMethodDelegate extends CPPFunction.CPPFunctionDelegate implements ICPPMethod {
|
|
||||||
public CPPMethodDelegate( ICPPUsingDeclaration name, ICPPMethod binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public int getVisibility() throws DOMException {
|
|
||||||
return ((ICPPMethod)getBinding()).getVisibility();
|
|
||||||
}
|
|
||||||
public ICPPClassType getClassOwner() throws DOMException {
|
|
||||||
return ((ICPPMethod)getBinding()).getClassOwner();
|
|
||||||
}
|
|
||||||
public boolean isVirtual() throws DOMException {
|
|
||||||
return ((ICPPMethod)getBinding()).isVirtual();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isDestructor()
|
|
||||||
*/
|
|
||||||
public boolean isDestructor() {
|
|
||||||
char[] name = getNameCharArray();
|
|
||||||
if (name.length > 1 && name[0] == '~')
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean isImplicit() {
|
|
||||||
return ((ICPPMethod)getBinding()).isImplicit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CPPMethodProblem extends CPPFunctionProblem implements ICPPMethod {
|
public static class CPPMethodProblem extends CPPFunctionProblem implements ICPPMethod {
|
||||||
/**
|
/**
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -189,6 +158,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return scope.getClassType();
|
return scope.getClassType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : definition;
|
IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : definition;
|
||||||
if( node instanceof IASTDeclarator ){
|
if( node instanceof IASTDeclarator ){
|
||||||
|
@ -202,6 +172,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return CPPVisitor.getContainingScope( node );
|
return CPPVisitor.getContainingScope( node );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if( definition != null ){
|
if( definition != null ){
|
||||||
IASTName n = definition.getName();
|
IASTName n = definition.getName();
|
||||||
|
@ -217,6 +188,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
if( definition != null ){
|
if( definition != null ){
|
||||||
IASTName n = definition.getName();
|
IASTName n = definition.getName();
|
||||||
|
@ -229,13 +201,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return declarations[0].getName().toCharArray();
|
return declarations[0].getName().toCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPMethodDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
|
||||||
*/
|
*/
|
||||||
|
@ -262,6 +227,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isInline()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isInline()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInline() throws DOMException {
|
public boolean isInline() throws DOMException {
|
||||||
IASTDeclaration decl = getPrimaryDeclaration();
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
if( decl instanceof IASTFunctionDefinition )
|
if( decl instanceof IASTFunctionDefinition )
|
||||||
|
@ -276,6 +242,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isMutable()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isMutable()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isMutable() {
|
public boolean isMutable() {
|
||||||
return hasStorageClass( this, ICPPASTDeclSpecifier.sc_mutable );
|
return hasStorageClass( this, ICPPASTDeclSpecifier.sc_mutable );
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectSet;
|
import org.eclipse.cdt.core.parser.util.ObjectSet;
|
||||||
|
@ -46,17 +44,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPInternalBinding {
|
public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPInternalBinding {
|
||||||
public static class CPPNamespaceDelegate extends CPPDelegate implements ICPPNamespace {
|
|
||||||
public CPPNamespaceDelegate( ICPPUsingDeclaration name, ICPPNamespace binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public ICPPNamespaceScope getNamespaceScope() throws DOMException {
|
|
||||||
return ((ICPPNamespace)getBinding()).getNamespaceScope();
|
|
||||||
}
|
|
||||||
public IBinding[] getMemberBindings() throws DOMException {
|
|
||||||
return ((ICPPNamespace)getBinding()).getMemberBindings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class CPPNamespaceProblem extends ProblemBinding implements ICPPNamespace{
|
public static class CPPNamespaceProblem extends ProblemBinding implements ICPPNamespace{
|
||||||
public CPPNamespaceProblem( IASTNode node, int id, char[] arg ) {
|
public CPPNamespaceProblem( IASTNode node, int id, char[] arg ) {
|
||||||
super( node, id, arg );
|
super( node, id, arg );
|
||||||
|
@ -114,6 +101,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
this.namespaceDef = ns;
|
this.namespaceDef = ns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( ICPPASTNamespaceDefinition namespace) {
|
public int visit( ICPPASTNamespaceDefinition namespace) {
|
||||||
ICPPASTNamespaceDefinition orig = namespaceDef, candidate = namespace;
|
ICPPASTNamespaceDefinition orig = namespaceDef, candidate = namespace;
|
||||||
while( candidate != null ){
|
while( candidate != null ){
|
||||||
|
@ -135,6 +123,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( IASTDeclaration declaration ){
|
public int visit( IASTDeclaration declaration ){
|
||||||
if( declaration instanceof ICPPASTLinkageSpecification )
|
if( declaration instanceof ICPPASTLinkageSpecification )
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
@ -155,6 +144,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
shouldVisitDeclarations = true;
|
shouldVisitDeclarations = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
while( declarator.getNestedDeclarator() != null )
|
while( declarator.getNestedDeclarator() != null )
|
||||||
declarator = declarator.getNestedDeclarator();
|
declarator = declarator.getNestedDeclarator();
|
||||||
|
@ -165,6 +155,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
|
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclSpecifier declSpec) {
|
public int visit(IASTDeclSpecifier declSpec) {
|
||||||
if( declSpec instanceof ICPPASTCompositeTypeSpecifier ){
|
if( declSpec instanceof ICPPASTCompositeTypeSpecifier ){
|
||||||
IBinding binding = ((ICPPASTCompositeTypeSpecifier)declSpec).getName().resolveBinding();
|
IBinding binding = ((ICPPASTCompositeTypeSpecifier)declSpec).getName().resolveBinding();
|
||||||
|
@ -185,12 +176,14 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
}
|
}
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(ICPPASTNamespaceDefinition namespace) {
|
public int visit(ICPPASTNamespaceDefinition namespace) {
|
||||||
IBinding binding = namespace.getName().resolveBinding();
|
IBinding binding = namespace.getName().resolveBinding();
|
||||||
if( binding != null && !(binding instanceof IProblemBinding) )
|
if( binding != null && !(binding instanceof IProblemBinding) )
|
||||||
members.put( binding );
|
members.put( binding );
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
if( declaration instanceof ICPPASTUsingDeclaration ){
|
if( declaration instanceof ICPPASTUsingDeclaration ){
|
||||||
IBinding binding =((ICPPASTUsingDeclaration)declaration).getName().resolveBinding();
|
IBinding binding =((ICPPASTUsingDeclaration)declaration).getName().resolveBinding();
|
||||||
|
@ -300,13 +293,6 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPNamespaceDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,11 +18,9 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
|
@ -49,13 +47,6 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
|
||||||
return namespace.getNamespaceScope();
|
return namespace.getNamespaceScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getDelegateType()
|
|
||||||
*/
|
|
||||||
public int getDelegateType() {
|
|
||||||
return ICPPDelegate.NAMESPACE_ALIAS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate#getBinding()
|
||||||
*/
|
*/
|
||||||
|
@ -125,14 +116,6 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
|
||||||
return alias;
|
return alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,12 +21,9 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
@ -37,36 +34,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPInternalBinding {
|
public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPInternalBinding {
|
||||||
public static class CPPParameterDelegate extends CPPDelegate implements ICPPParameter {
|
|
||||||
public CPPParameterDelegate( ICPPUsingDeclaration name, IParameter binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public IType getType() throws DOMException {
|
|
||||||
return ((IParameter)getBinding()).getType();
|
|
||||||
}
|
|
||||||
public boolean isStatic() throws DOMException {
|
|
||||||
return ((IParameter)getBinding()).isStatic();
|
|
||||||
}
|
|
||||||
public boolean isExtern() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean isAuto() throws DOMException {
|
|
||||||
return ((IParameter)getBinding()).isAuto();
|
|
||||||
}
|
|
||||||
public boolean isRegister() throws DOMException {
|
|
||||||
return ((IParameter)getBinding()).isRegister();
|
|
||||||
}
|
|
||||||
public boolean isMutable() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean hasDefaultValue() {
|
|
||||||
return ((ICPPParameter)getBinding()).hasDefaultValue();
|
|
||||||
}
|
|
||||||
public boolean isExternC() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CPPParameterProblem extends ProblemBinding implements ICPPParameter {
|
public static class CPPParameterProblem extends ProblemBinding implements ICPPParameter {
|
||||||
public CPPParameterProblem( IASTNode node, int id, char[] arg ) {
|
public CPPParameterProblem( IASTNode node, int id, char[] arg ) {
|
||||||
super( node, id, arg );
|
super( node, id, arg );
|
||||||
|
@ -240,13 +207,6 @@ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPParameterDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,12 +13,9 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter.CPPParameterDelegate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -88,10 +85,6 @@ public class CPPParameterSpecialization extends CPPSpecialization implements ICP
|
||||||
return getParameter().hasDefaultValue();
|
return getParameter().hasDefaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPParameterDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isExternC() {
|
public boolean isExternC() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceAlias;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceAlias;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSwitchStatement;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSwitchStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
||||||
|
@ -103,7 +102,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
|
@ -1343,9 +1341,6 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
|
|
||||||
IBinding binding = ( n instanceof IBinding) ? (IBinding)n : ((IASTName)n).resolveBinding();
|
IBinding binding = ( n instanceof IBinding) ? (IBinding)n : ((IASTName)n).resolveBinding();
|
||||||
while( binding instanceof ICPPDelegate ){
|
|
||||||
binding = ((ICPPDelegate)binding).getBinding();
|
|
||||||
}
|
|
||||||
Object [] objs = ( names instanceof Object[] ) ? (Object[])names : null;
|
Object [] objs = ( names instanceof Object[] ) ? (Object[])names : null;
|
||||||
int idx = ( objs != null && objs.length > 0 ) ? 0 : -1;
|
int idx = ( objs != null && objs.length > 0 ) ? 0 : -1;
|
||||||
Object o = ( idx != -1 ) ? objs[idx++] : names;
|
Object o = ( idx != -1 ) ? objs[idx++] : names;
|
||||||
|
@ -1355,9 +1350,6 @@ public class CPPSemantics {
|
||||||
if( b instanceof ICPPUsingDeclaration ){
|
if( b instanceof ICPPUsingDeclaration ){
|
||||||
objs = ArrayUtil.append( Object.class, objs, ((ICPPUsingDeclaration)b).getDelegates() );
|
objs = ArrayUtil.append( Object.class, objs, ((ICPPUsingDeclaration)b).getDelegates() );
|
||||||
} else {
|
} else {
|
||||||
while( b instanceof ICPPDelegate ){
|
|
||||||
b = ((ICPPDelegate)b).getBinding();
|
|
||||||
}
|
|
||||||
if( binding != b )
|
if( binding != b )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -2082,12 +2074,6 @@ public class CPPSemantics {
|
||||||
} else if( temp instanceof IType ){
|
} else if( temp instanceof IType ){
|
||||||
if( type == null ){
|
if( type == null ){
|
||||||
type = temp;
|
type = temp;
|
||||||
} else if( (temp instanceof ICPPDelegate && ((ICPPDelegate)temp).getBinding() == type) ||
|
|
||||||
(type instanceof ICPPDelegate && ((ICPPDelegate)type).getBinding() == temp) ||
|
|
||||||
(type instanceof ICPPDelegate && temp instanceof ICPPDelegate &&
|
|
||||||
((ICPPDelegate)type).getBinding() == ((ICPPDelegate)temp).getBinding()) )
|
|
||||||
{
|
|
||||||
//ok, delegates are synonyms
|
|
||||||
} else if( type instanceof ICPPClassTemplate && temp instanceof ICPPSpecialization &&
|
} else if( type instanceof ICPPClassTemplate && temp instanceof ICPPSpecialization &&
|
||||||
((IType) type).isSameType((IType) ((ICPPSpecialization)temp).getSpecializedBinding()))
|
((IType) type).isSameType((IType) ((ICPPSpecialization)temp).getSpecializedBinding()))
|
||||||
{
|
{
|
||||||
|
@ -2098,9 +2084,7 @@ public class CPPSemantics {
|
||||||
} else {
|
} else {
|
||||||
if( obj == null)
|
if( obj == null)
|
||||||
obj = temp;
|
obj = temp;
|
||||||
else if ( obj == temp ||
|
else if ( obj == temp ) {
|
||||||
(temp instanceof ICPPDelegate && ((ICPPDelegate)temp).getBinding() == obj) ||
|
|
||||||
(obj instanceof ICPPDelegate && ((ICPPDelegate)obj).getBinding() == temp)) {
|
|
||||||
//ok, delegates are synonyms
|
//ok, delegates are synonyms
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2172,9 +2156,6 @@ public class CPPSemantics {
|
||||||
if (binding instanceof ICPPSpecialization) {
|
if (binding instanceof ICPPSpecialization) {
|
||||||
return ((ICPPSpecialization) binding).getSpecializedBinding() instanceof IIndexBinding;
|
return ((ICPPSpecialization) binding).getSpecializedBinding() instanceof IIndexBinding;
|
||||||
}
|
}
|
||||||
if (binding instanceof ICPPDelegate) {
|
|
||||||
return ((ICPPDelegate) binding).getBinding() instanceof IIndexBinding;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2387,52 +2368,39 @@ public class CPPSemantics {
|
||||||
boolean currHasAmbiguousParam = false; //currFn has an ambiguous parameter conversion (ok if not bestFn)
|
boolean currHasAmbiguousParam = false; //currFn has an ambiguous parameter conversion (ok if not bestFn)
|
||||||
boolean bestHasAmbiguousParam = false; //bestFn has an ambiguous parameter conversion (not ok, ambiguous)
|
boolean bestHasAmbiguousParam = false; //bestFn has an ambiguous parameter conversion (not ok, ambiguous)
|
||||||
|
|
||||||
IType [] sourceParameters = getSourceParameterTypes( data.functionParameters ); //the parameters the function is being called with
|
final IType[] sourceParameters = getSourceParameterTypes( data.functionParameters ); //the parameters the function is being called with
|
||||||
IType [] targetParameters = null;
|
final boolean sourceVoid = ( data.functionParameters == null || data.functionParameters.length == 0 );
|
||||||
boolean sourceVoid = ( data.functionParameters == null || data.functionParameters.length == 0 );
|
final IType impliedObjectType = data.getImpliedObjectArgument();
|
||||||
int numSourceParams = 0;
|
|
||||||
int targetLength = 0;
|
|
||||||
int numFns = fns.length;
|
|
||||||
|
|
||||||
IType impliedObjectType = data.getImpliedObjectArgument();
|
// loop over all functions
|
||||||
|
function_loop: for( int fnIdx = 0; fnIdx < fns.length; fnIdx++ ){
|
||||||
outer: for( int fnIdx = 0; fnIdx < numFns; fnIdx++ ){
|
|
||||||
currFn = (IFunction) fns[fnIdx];
|
currFn = (IFunction) fns[fnIdx];
|
||||||
|
if (currFn == null || bestFn == currFn) {
|
||||||
if (currFn == null || bestFn == currFn ||
|
|
||||||
(bestFn instanceof ICPPDelegate && currFn.equals(((ICPPDelegate)bestFn).getBinding())) ||
|
|
||||||
(bestFn != null && currFn instanceof ICPPDelegate && bestFn.equals(((ICPPDelegate)currFn).getBinding())) )
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
targetParameters = getTargetParameterTypes( currFn );
|
final IType[] targetParameters = getTargetParameterTypes(currFn);
|
||||||
|
final int useImplicitObj = (currFn instanceof ICPPMethod && !(currFn instanceof ICPPConstructor)) ? 1 : 0;
|
||||||
|
final int sourceLen= Math.max(sourceParameters.length + useImplicitObj, 1);
|
||||||
|
final int numTargetParams= Math.max(targetParameters.length, 1+useImplicitObj);
|
||||||
|
|
||||||
targetLength = targetParameters.length;
|
if (currFnCost == null || currFnCost.length != sourceLen) {
|
||||||
boolean useImplicitObj = ( currFn instanceof ICPPMethod && !(currFn instanceof ICPPConstructor) );
|
currFnCost= new Cost[sourceLen];
|
||||||
numSourceParams = ( useImplicitObj ) ? sourceParameters.length + 1 : sourceParameters.length;
|
|
||||||
int numTargetParams = 0;
|
|
||||||
|
|
||||||
if( currFnCost == null || currFnCost.length != ((numSourceParams == 0) ? 1 : numSourceParams) ){
|
|
||||||
currFnCost = new Cost [ (numSourceParams == 0) ? 1 : numSourceParams ];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
comparison = 0;
|
comparison = 0;
|
||||||
boolean varArgs = false;
|
boolean varArgs = false;
|
||||||
|
boolean isImpliedObject= false;
|
||||||
for( int j = 0; j < numSourceParams || j == 0; j++ ){
|
for (int j = 0; j < sourceLen; j++) {
|
||||||
if( useImplicitObj ) {
|
if (useImplicitObj > 0) {
|
||||||
source = ( j == 0 ) ? impliedObjectType : sourceParameters[j - 1];
|
isImpliedObject= j==0;
|
||||||
numTargetParams = ( targetLength == 1 ) ? 2 : targetLength;
|
source = isImpliedObject ? impliedObjectType : sourceParameters[j - 1];
|
||||||
} else {
|
} else {
|
||||||
source = sourceParameters[j];
|
source = sourceParameters[j];
|
||||||
numTargetParams = ( targetLength == 0 ) ? 1 : targetLength;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j < numTargetParams) {
|
if (j < numTargetParams) {
|
||||||
if( (useImplicitObj && targetLength == 1 && j == 1) ||
|
if (j == targetParameters.length) {
|
||||||
(!useImplicitObj && targetLength == 0 && j == 0) )
|
|
||||||
{
|
|
||||||
target = VOID_TYPE;
|
target = VOID_TYPE;
|
||||||
} else {
|
} else {
|
||||||
target = targetParameters[j];
|
target = targetParameters[j];
|
||||||
|
@ -2440,27 +2408,24 @@ public class CPPSemantics {
|
||||||
} else
|
} else
|
||||||
varArgs = true;
|
varArgs = true;
|
||||||
|
|
||||||
if( useImplicitObj && j == 0 && ASTInternal.isStatic(currFn, false)) {
|
if (isImpliedObject && ASTInternal.isStatic(currFn, false)) {
|
||||||
//13.3.1-4 for static member functions, the implicit object parameter is considered to match any object
|
//13.3.1-4 for static member functions, the implicit object parameter is considered to match any object
|
||||||
cost = new Cost(source, target);
|
cost = new Cost(source, target);
|
||||||
cost.rank = Cost.IDENTITY_RANK; //exact match, no cost
|
cost.rank = Cost.IDENTITY_RANK; //exact match, no cost
|
||||||
} else if (source == null) {
|
} else if (source == null) {
|
||||||
continue outer;
|
continue function_loop;
|
||||||
} else if (varArgs) {
|
} else if (varArgs) {
|
||||||
cost = new Cost(source, null);
|
cost = new Cost(source, null);
|
||||||
cost.rank = Cost.ELLIPSIS_CONVERSION;
|
cost.rank = Cost.ELLIPSIS_CONVERSION;
|
||||||
} else if( source.isSameType( target ) ||
|
} else if (source.isSameType(target) || (sourceVoid && j == useImplicitObj)) {
|
||||||
( sourceVoid && ((useImplicitObj && j == 1)||(!useImplicitObj && j == 0)) ) )
|
|
||||||
{
|
|
||||||
cost = new Cost( source, target );
|
cost = new Cost( source, target );
|
||||||
cost.rank = Cost.IDENTITY_RANK; //exact match, no cost
|
cost.rank = Cost.IDENTITY_RANK; //exact match, no cost
|
||||||
} else {
|
} else {
|
||||||
cost = checkStandardConversionSequence( source, target );
|
cost = checkStandardConversionSequence( source, target, isImpliedObject);
|
||||||
//12.3-4 At most one user-defined conversion is implicitly applied to
|
//12.3-4 At most one user-defined conversion is implicitly applied to
|
||||||
//a single value. (also prevents infinite loop)
|
//a single value. (also prevents infinite loop)
|
||||||
if( (cost.rank == Cost.NO_MATCH_RANK || cost.rank == Cost.FUZZY_TEMPLATE_PARAMETERS ) &&
|
if (!data.forUserDefinedConversion && (cost.rank == Cost.NO_MATCH_RANK ||
|
||||||
!data.forUserDefinedConversion )
|
cost.rank == Cost.FUZZY_TEMPLATE_PARAMETERS)) {
|
||||||
{
|
|
||||||
temp = checkUserDefinedConversionSequence( source, target );
|
temp = checkUserDefinedConversionSequence( source, target );
|
||||||
if( temp != null ){
|
if( temp != null ){
|
||||||
cost = temp;
|
cost = temp;
|
||||||
|
@ -2790,15 +2755,24 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
static protected Cost checkStandardConversionSequence( IType source, IType target ) throws DOMException {
|
* Computes the cost of using the standard conversion sequence from source to target.
|
||||||
|
* @param ignoreDerivedToBaseConversion handles the special case when members of different
|
||||||
|
* classes are nominated via using-declarations. In such a situation the derived to
|
||||||
|
* base conversion does not cause any costs.
|
||||||
|
* @throws DOMException
|
||||||
|
*/
|
||||||
|
static protected Cost checkStandardConversionSequence( IType source, IType target, boolean isImplicitThis) throws DOMException {
|
||||||
Cost cost = lvalue_to_rvalue( source, target );
|
Cost cost = lvalue_to_rvalue( source, target );
|
||||||
|
|
||||||
if( cost.source == null || cost.target == null ){
|
if( cost.source == null || cost.target == null ){
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cost.source.isSameType( cost.target ) ){
|
if (cost.source.isSameType(cost.target) ||
|
||||||
|
// 7.3.3.13 for overload resolution the implicit this pointer is treated as if
|
||||||
|
// it were a pointer to the derived class
|
||||||
|
(isImplicitThis && cost.source instanceof ICPPClassType && cost.target instanceof ICPPClassType)) {
|
||||||
cost.rank = Cost.IDENTITY_RANK;
|
cost.rank = Cost.IDENTITY_RANK;
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
@ -2819,7 +2793,10 @@ public class CPPSemantics {
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( s.isSameType( t ) ){
|
if (s.isSameType(t) ||
|
||||||
|
// 7.3.3.13 for overload resolution the implicit this pointer is treated as if
|
||||||
|
// it were a pointer to the derived class
|
||||||
|
(isImplicitThis && s instanceof ICPPClassType && t instanceof ICPPClassType)) {
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2868,7 +2845,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( constructor != null && !constructor.isExplicit() ){
|
if( constructor != null && !constructor.isExplicit() ){
|
||||||
constructorCost = checkStandardConversionSequence( t, target );
|
constructorCost = checkStandardConversionSequence( t, target, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2878,7 +2855,7 @@ public class CPPSemantics {
|
||||||
if( ops.length > 0 && !(ops[0] instanceof IProblemBinding) ){
|
if( ops.length > 0 && !(ops[0] instanceof IProblemBinding) ){
|
||||||
Cost [] costs = null;
|
Cost [] costs = null;
|
||||||
for (int i = 0; i < ops.length; i++) {
|
for (int i = 0; i < ops.length; i++) {
|
||||||
cost = checkStandardConversionSequence( ops[i].getType().getReturnType(), target );
|
cost = checkStandardConversionSequence( ops[i].getType().getReturnType(), target, false );
|
||||||
if( cost.rank != Cost.NO_MATCH_RANK )
|
if( cost.rank != Cost.NO_MATCH_RANK )
|
||||||
costs = (Cost[]) ArrayUtil.append( Cost.class, costs, cost );
|
costs = (Cost[]) ArrayUtil.append( Cost.class, costs, cost );
|
||||||
}
|
}
|
||||||
|
@ -3483,10 +3460,7 @@ public class CPPSemantics {
|
||||||
|
|
||||||
if( binding != null )
|
if( binding != null )
|
||||||
if( binding instanceof ICPPUsingDeclaration ){
|
if( binding instanceof ICPPUsingDeclaration ){
|
||||||
try {
|
|
||||||
set.addAll( ((ICPPUsingDeclaration)binding).getDelegates() );
|
set.addAll( ((ICPPUsingDeclaration)binding).getDelegates() );
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
|
||||||
} else if( binding instanceof CPPCompositeBinding ){
|
} else if( binding instanceof CPPCompositeBinding ){
|
||||||
set.addAll( ((CPPCompositeBinding)binding).getBindings() );
|
set.addAll( ((CPPCompositeBinding)binding).getBindings() );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,9 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -94,17 +92,10 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
@ -113,6 +104,7 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
@ -34,6 +32,7 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
|
||||||
declarations = new IASTName[] { name };
|
declarations = new IASTName[] { name };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
IType t = null;
|
IType t = null;
|
||||||
try {
|
try {
|
||||||
|
@ -106,14 +105,6 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@ -149,6 +140,7 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
|
||||||
return Linkage.CPP_LINKAGE;
|
return Linkage.CPP_LINKAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,14 +26,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
|
|
||||||
|
@ -216,17 +214,10 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDefinition(IASTNode node) {
|
public void addDefinition(IASTNode node) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
@ -235,6 +226,7 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDeclaration(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTNode node) {
|
public void addDeclaration(IASTNode node) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -11,9 +11,6 @@
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
/*
|
|
||||||
* Created on Mar 11, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
|
@ -849,6 +846,7 @@ public class CPPTemplates {
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
this.bindings = bindings;
|
this.bindings = bindings;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTName name) {
|
public int visit(IASTName name) {
|
||||||
if (name.getBinding() != null) {
|
if (name.getBinding() != null) {
|
||||||
IBinding binding = name.getBinding();
|
IBinding binding = name.getBinding();
|
||||||
|
@ -870,6 +868,7 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@ -1428,15 +1427,19 @@ public class CPPTemplates {
|
||||||
this.functionParameters = functionParameters;
|
this.functionParameters = functionParameters;
|
||||||
this.templateParameters = templateParameters;
|
this.templateParameters = templateParameters;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IParameter[] getParameters() {
|
public IParameter[] getParameters() {
|
||||||
return functionParameters;
|
return functionParameters;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public ICPPTemplateParameter[] getTemplateParameters() {
|
public ICPPTemplateParameter[] getTemplateParameters() {
|
||||||
return templateParameters;
|
return templateParameters;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public IFunctionType getType() {
|
public IFunctionType getType() {
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
type = CPPVisitor.createImplicitFunctionType(new CPPBasicType(IBasicType.t_void, 0), functionParameters);
|
type = CPPVisitor.createImplicitFunctionType(new CPPBasicType(IBasicType.t_void, 0), functionParameters);
|
||||||
|
@ -1532,7 +1535,7 @@ public class CPPTemplates {
|
||||||
pType = e.getProblem();
|
pType = e.getProblem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Cost cost = CPPSemantics.checkStandardConversionSequence(argument, pType);
|
Cost cost = CPPSemantics.checkStandardConversionSequence(argument, pType, false);
|
||||||
|
|
||||||
if (cost == null || cost.rank == Cost.NO_MATCH_RANK) {
|
if (cost == null || cost.rank == Cost.NO_MATCH_RANK) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -20,8 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
@ -32,20 +30,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding {
|
public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding {
|
||||||
public static class CPPTypedefDelegate extends CPPDelegate implements ITypedef, ITypeContainer {
|
|
||||||
public CPPTypedefDelegate(ICPPUsingDeclaration name, ITypedef binding) {
|
|
||||||
super(name, binding);
|
|
||||||
}
|
|
||||||
public IType getType() throws DOMException {
|
|
||||||
return ((ITypedef)getBinding()).getType();
|
|
||||||
}
|
|
||||||
public boolean isSameType(IType type) {
|
|
||||||
return ((ITypedef)getBinding()).isSameType(type);
|
|
||||||
}
|
|
||||||
public void setType(IType type) {
|
|
||||||
((ITypeContainer)getBinding()).setType(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IASTName[] declarations = null;
|
private IASTName[] declarations = null;
|
||||||
private IType type = null;
|
private IType type = null;
|
||||||
|
@ -128,6 +112,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
return CPPVisitor.getContainingScope(declarations[0].getParent());
|
return CPPVisitor.getContainingScope(declarations[0].getParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
IType t = null;
|
IType t = null;
|
||||||
try {
|
try {
|
||||||
|
@ -164,13 +149,6 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPTypedefDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
@ -207,6 +185,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
return Linkage.CPP_LINKAGE;
|
return Linkage.CPP_LINKAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,9 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef.CPPTypedefDelegate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -54,6 +51,7 @@ public class CPPTypedefSpecialization extends CPPSpecialization implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#clone()
|
* @see java.lang.Object#clone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
IType t = null;
|
IType t = null;
|
||||||
try {
|
try {
|
||||||
|
@ -90,13 +88,6 @@ public class CPPTypedefSpecialization extends CPPSpecialization implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPTypedefDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(IType type) {
|
public void setType(IType type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
|
@ -69,13 +67,6 @@ public class CPPUnknownBinding extends PlatformObject implements ICPPInternalUnk
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl1 ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*
|
|
||||||
* Created on Mar 16, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ILinkage;
|
import org.eclipse.cdt.core.dom.ILinkage;
|
||||||
|
@ -24,9 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
|
@ -35,7 +29,7 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
*/
|
*/
|
||||||
public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDeclaration, ICPPInternalBinding{
|
public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDeclaration, ICPPInternalBinding{
|
||||||
private IASTName name;
|
private IASTName name;
|
||||||
private ICPPDelegate [] delegates;
|
private IBinding [] delegates;
|
||||||
|
|
||||||
public CPPUsingDeclaration( IASTName name, IBinding [] bindings ) {
|
public CPPUsingDeclaration( IASTName name, IBinding [] bindings ) {
|
||||||
if( name instanceof ICPPASTQualifiedName ){
|
if( name instanceof ICPPASTQualifiedName ){
|
||||||
|
@ -43,24 +37,13 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl
|
||||||
name = ns[ ns.length - 1 ];
|
name = ns[ ns.length - 1 ];
|
||||||
}
|
}
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.delegates = createDelegates( bindings );
|
this.delegates= bindings;
|
||||||
}
|
|
||||||
|
|
||||||
private ICPPDelegate [] createDelegates( IBinding [] bindings ){
|
|
||||||
ICPPDelegate [] result = null;
|
|
||||||
for( int i = 0; i < bindings.length; i++ ){
|
|
||||||
if( bindings[i] instanceof ICPPDelegateCreator){
|
|
||||||
ICPPDelegate delegate = ((ICPPDelegateCreator)bindings[i]).createDelegate( this );
|
|
||||||
result = (ICPPDelegate[]) ArrayUtil.append( ICPPDelegate.class, result, delegate );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (ICPPDelegate[]) ArrayUtil.trim( ICPPDelegate.class, result );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration#getDelegates()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration#getDelegates()
|
||||||
*/
|
*/
|
||||||
public ICPPDelegate[] getDelegates() {
|
public IBinding[] getDelegates() {
|
||||||
return delegates;
|
return delegates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,13 +113,6 @@ public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDecl
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,8 +25,6 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
|
@ -38,32 +36,6 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInternalVariable {
|
public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInternalVariable {
|
||||||
public static class CPPVariableDelegate extends CPPDelegate implements ICPPVariable {
|
|
||||||
public CPPVariableDelegate( ICPPUsingDeclaration name, ICPPVariable binding ) {
|
|
||||||
super( name, binding );
|
|
||||||
}
|
|
||||||
public IType getType() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).getType();
|
|
||||||
}
|
|
||||||
public boolean isStatic() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isStatic();
|
|
||||||
}
|
|
||||||
public boolean isMutable() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isMutable();
|
|
||||||
}
|
|
||||||
public boolean isExtern() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isExtern();
|
|
||||||
}
|
|
||||||
public boolean isExternC() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isExternC();
|
|
||||||
}
|
|
||||||
public boolean isAuto() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isAuto();
|
|
||||||
}
|
|
||||||
public boolean isRegister() throws DOMException {
|
|
||||||
return ((ICPPVariable)getBinding()).isRegister();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class CPPVariableProblem extends ProblemBinding implements ICPPVariable{
|
public static class CPPVariableProblem extends ProblemBinding implements ICPPVariable{
|
||||||
public CPPVariableProblem( IASTNode node, int id, char[] arg ) {
|
public CPPVariableProblem( IASTNode node, int id, char[] arg ) {
|
||||||
super( node, id, arg );
|
super( node, id, arg );
|
||||||
|
@ -285,13 +257,6 @@ public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInt
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#createDelegate(org.eclipse.cdt.core.dom.ast.IASTName)
|
|
||||||
*/
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl ) {
|
|
||||||
return new CPPVariableDelegate( usingDecl, this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
* @see org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding#addDefinition(org.eclipse.cdt.core.dom.ast.IASTNode)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -118,7 +118,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
|
@ -1066,6 +1065,7 @@ public class CPPVisitor {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processDeclaration(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processDeclaration(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
if ( declaration instanceof IASTProblemHolder )
|
if ( declaration instanceof IASTProblemHolder )
|
||||||
addProblem(((IASTProblemHolder)declaration).getProblem());
|
addProblem(((IASTProblemHolder)declaration).getProblem());
|
||||||
|
@ -1075,6 +1075,7 @@ public class CPPVisitor {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processExpression(org.eclipse.cdt.core.dom.ast.IASTExpression)
|
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processExpression(org.eclipse.cdt.core.dom.ast.IASTExpression)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int visit(IASTExpression expression) {
|
public int visit(IASTExpression expression) {
|
||||||
if ( expression instanceof IASTProblemHolder )
|
if ( expression instanceof IASTProblemHolder )
|
||||||
addProblem(((IASTProblemHolder)expression).getProblem());
|
addProblem(((IASTProblemHolder)expression).getProblem());
|
||||||
|
@ -1085,6 +1086,7 @@ public class CPPVisitor {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processStatement(org.eclipse.cdt.core.dom.ast.IASTStatement)
|
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processStatement(org.eclipse.cdt.core.dom.ast.IASTStatement)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
if ( statement instanceof IASTProblemHolder )
|
if ( statement instanceof IASTProblemHolder )
|
||||||
addProblem(((IASTProblemHolder)statement).getProblem());
|
addProblem(((IASTProblemHolder)statement).getProblem());
|
||||||
|
@ -1095,6 +1097,7 @@ public class CPPVisitor {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processTypeId(org.eclipse.cdt.core.dom.ast.IASTTypeId)
|
* @see org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction#processTypeId(org.eclipse.cdt.core.dom.ast.IASTTypeId)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int visit(IASTTypeId typeId) {
|
public int visit(IASTTypeId typeId) {
|
||||||
if ( typeId instanceof IASTProblemHolder )
|
if ( typeId instanceof IASTProblemHolder )
|
||||||
addProblem(((IASTProblemHolder)typeId).getProblem());
|
addProblem(((IASTProblemHolder)typeId).getProblem());
|
||||||
|
@ -1124,15 +1127,7 @@ public class CPPVisitor {
|
||||||
|
|
||||||
this.bindings = new IBinding[] {binding};
|
this.bindings = new IBinding[] {binding};
|
||||||
if (binding instanceof ICPPUsingDeclaration) {
|
if (binding instanceof ICPPUsingDeclaration) {
|
||||||
try {
|
this.bindings= ((ICPPUsingDeclaration) binding).getDelegates();
|
||||||
ICPPDelegate[] delegates= ((ICPPUsingDeclaration) binding).getDelegates();
|
|
||||||
this.bindings= new IBinding[delegates.length+1];
|
|
||||||
this.bindings[0]= binding;
|
|
||||||
for (int i=0; i < delegates.length; i++) {
|
|
||||||
this.bindings[i+1]= delegates[i].getBinding();
|
|
||||||
}
|
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
|
||||||
kind= KIND_COMPOSITE;
|
kind= KIND_COMPOSITE;
|
||||||
}
|
}
|
||||||
else if( binding instanceof ILabel )
|
else if( binding instanceof ILabel )
|
||||||
|
@ -1152,6 +1147,7 @@ public class CPPVisitor {
|
||||||
kind = KIND_OBJ_FN;
|
kind = KIND_OBJ_FN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( IASTName name ){
|
public int visit( IASTName name ){
|
||||||
if( name instanceof ICPPASTQualifiedName ) return PROCESS_CONTINUE;
|
if( name instanceof ICPPASTQualifiedName ) return PROCESS_CONTINUE;
|
||||||
|
|
||||||
|
@ -1245,12 +1241,9 @@ public class CPPVisitor {
|
||||||
}
|
}
|
||||||
// a using declaration is a declaration for the references of its delegates
|
// a using declaration is a declaration for the references of its delegates
|
||||||
if (nameBinding instanceof ICPPUsingDeclaration) {
|
if (nameBinding instanceof ICPPUsingDeclaration) {
|
||||||
try {
|
|
||||||
if (ArrayUtil.contains(((ICPPUsingDeclaration) nameBinding).getDelegates(), bindings[i])) {
|
if (ArrayUtil.contains(((ICPPUsingDeclaration) nameBinding).getDelegates(), bindings[i])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1272,13 +1265,6 @@ public class CPPVisitor {
|
||||||
while(true) {
|
while(true) {
|
||||||
if (binding instanceof ICPPSpecialization) {
|
if (binding instanceof ICPPSpecialization) {
|
||||||
binding= ((ICPPSpecialization) binding).getSpecializedBinding();
|
binding= ((ICPPSpecialization) binding).getSpecializedBinding();
|
||||||
} else if (binding instanceof ICPPDelegate) {
|
|
||||||
ICPPDelegate delegate= (ICPPDelegate) binding;
|
|
||||||
if (delegate.getDelegateType() == ICPPDelegate.USING_DECLARATION) {
|
|
||||||
binding= delegate.getBinding();
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1308,14 +1294,7 @@ public class CPPVisitor {
|
||||||
this.bindings = new IBinding[] {binding};
|
this.bindings = new IBinding[] {binding};
|
||||||
|
|
||||||
if (binding instanceof ICPPUsingDeclaration) {
|
if (binding instanceof ICPPUsingDeclaration) {
|
||||||
try {
|
this.bindings= ((ICPPUsingDeclaration) binding).getDelegates();
|
||||||
ICPPDelegate[] delegates= ((ICPPUsingDeclaration) binding).getDelegates();
|
|
||||||
this.bindings= new IBinding[delegates.length];
|
|
||||||
for (int i = 0; i < delegates.length; i++) {
|
|
||||||
binding= this.bindings[i]= delegates[i].getBinding();
|
|
||||||
}
|
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
|
||||||
kind= KIND_COMPOSITE;
|
kind= KIND_COMPOSITE;
|
||||||
} else if( binding instanceof ILabel ) {
|
} else if( binding instanceof ILabel ) {
|
||||||
kind = KIND_LABEL;
|
kind = KIND_LABEL;
|
||||||
|
@ -1332,6 +1311,7 @@ public class CPPVisitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int visit( IASTName name ){
|
public int visit( IASTName name ){
|
||||||
if( name instanceof ICPPASTQualifiedName || name instanceof ICPPASTTemplateId ) return PROCESS_CONTINUE;
|
if( name instanceof ICPPASTQualifiedName || name instanceof ICPPASTTemplateId ) return PROCESS_CONTINUE;
|
||||||
|
|
||||||
|
@ -1417,16 +1397,13 @@ public class CPPVisitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nameBinding instanceof ICPPUsingDeclaration) {
|
if (nameBinding instanceof ICPPUsingDeclaration) {
|
||||||
try {
|
IBinding[] delegates= ((ICPPUsingDeclaration) nameBinding).getDelegates();
|
||||||
ICPPDelegate[] delegates= ((ICPPUsingDeclaration) nameBinding).getDelegates();
|
|
||||||
for (int i = 0; i < delegates.length; i++) {
|
for (int i = 0; i < delegates.length; i++) {
|
||||||
ICPPDelegate delegate = delegates[i];
|
IBinding delegate = delegates[i];
|
||||||
if (isReferenceBinding(delegate.getBinding())) {
|
if (isReferenceBinding(delegate)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
/**********************************************************************
|
|
||||||
* Copyright (c) 2007, 2008 QNX Software Systems and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* QNX Software Systems - Initial API and implementation
|
|
||||||
* Markus Schorn (Wind River Systems)
|
|
||||||
**********************************************************************/
|
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Doug Schaefer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface ICPPDelegateCreator {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a delegate binding for the using declaration provided.
|
|
||||||
* @param usingDecl
|
|
||||||
*/
|
|
||||||
ICPPDelegate createDelegate( ICPPUsingDeclaration usingDecl );
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,10 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
/*
|
|
||||||
* Created on Jan 24, 2005
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -20,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public interface ICPPInternalBinding extends ICPPBinding, ICPPDelegateCreator {
|
public interface ICPPInternalBinding extends ICPPBinding {
|
||||||
//methods required by the CPPVisitor but not meant for the public interface
|
//methods required by the CPPVisitor but not meant for the public interface
|
||||||
|
|
||||||
//implementors should keep the node with the lowest offset in declarations[0]
|
//implementors should keep the node with the lowest offset in declarations[0]
|
||||||
|
|
|
@ -27,10 +27,8 @@ import java.util.regex.Pattern;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ILinkage;
|
import org.eclipse.cdt.core.dom.ILinkage;
|
||||||
import org.eclipse.cdt.core.dom.IName;
|
import org.eclipse.cdt.core.dom.IName;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.index.IIndex;
|
import org.eclipse.cdt.core.index.IIndex;
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
|
@ -42,7 +40,6 @@ import org.eclipse.cdt.core.index.IIndexMacro;
|
||||||
import org.eclipse.cdt.core.index.IIndexName;
|
import org.eclipse.cdt.core.index.IIndexName;
|
||||||
import org.eclipse.cdt.core.index.IndexFilter;
|
import org.eclipse.cdt.core.index.IndexFilter;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDelegate;
|
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError;
|
import org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.c.CCompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.c.CCompositesFactory;
|
||||||
|
@ -125,12 +122,7 @@ public class CIndex implements IIndex {
|
||||||
public IIndexName[] findNames(IBinding binding, int flags) throws CoreException {
|
public IIndexName[] findNames(IBinding binding, int flags) throws CoreException {
|
||||||
LinkedList<IIndexFragmentName> result= new LinkedList<IIndexFragmentName>();
|
LinkedList<IIndexFragmentName> result= new LinkedList<IIndexFragmentName>();
|
||||||
if (binding instanceof ICPPUsingDeclaration) {
|
if (binding instanceof ICPPUsingDeclaration) {
|
||||||
ICPPDelegate[] bindings= null;
|
IBinding[] bindings= ((ICPPUsingDeclaration)binding).getDelegates();
|
||||||
try {
|
|
||||||
bindings = ((ICPPUsingDeclaration)binding).getDelegates();
|
|
||||||
} catch (DOMException e) {
|
|
||||||
CCorePlugin.log(e);
|
|
||||||
}
|
|
||||||
if (bindings == null || bindings.length == 0) {
|
if (bindings == null || bindings.length == 0) {
|
||||||
return new IIndexName[0];
|
return new IIndexName[0];
|
||||||
}
|
}
|
||||||
|
@ -143,16 +135,6 @@ public class CIndex implements IIndex {
|
||||||
return multi.toArray(new IIndexName[multi.size()]);
|
return multi.toArray(new IIndexName[multi.size()]);
|
||||||
}
|
}
|
||||||
binding= bindings[0];
|
binding= bindings[0];
|
||||||
} else if (binding instanceof CPPDelegate) {
|
|
||||||
CPPDelegate delegate= (CPPDelegate) binding;
|
|
||||||
if (delegate.getDelegateType() == ICPPDelegate.USING_DECLARATION) {
|
|
||||||
binding= delegate.getBinding();
|
|
||||||
IIndexFragmentBinding ib= (IIndexFragmentBinding) delegate.getUsingDeclaration().getAdapter(IIndexFragmentBinding.class);
|
|
||||||
if (ib != null) {
|
|
||||||
final IIndexFragmentName[] names= ib.getFragment().findNames(ib, flags);
|
|
||||||
result.addAll(Arrays.asList(names));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int fragCount= 0;
|
int fragCount= 0;
|
||||||
|
|
|
@ -18,15 +18,11 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||||
import org.eclipse.cdt.internal.core.index.CIndex;
|
import org.eclipse.cdt.internal.core.index.CIndex;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
|
@ -34,7 +30,7 @@ import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
public class CompositeCPPClassTemplate extends CompositeCPPClassType implements
|
public class CompositeCPPClassTemplate extends CompositeCPPClassType implements
|
||||||
ICPPClassTemplate, ICPPDelegateCreator, ICPPInternalTemplateInstantiator {
|
ICPPClassTemplate, ICPPInternalTemplateInstantiator {
|
||||||
|
|
||||||
public CompositeCPPClassTemplate(ICompositesFactory cf, ICPPClassType ct) {
|
public CompositeCPPClassTemplate(ICompositesFactory cf, ICPPClassType ct) {
|
||||||
super(cf, ct);
|
super(cf, ct);
|
||||||
|
@ -91,8 +87,4 @@ ICPPClassTemplate, ICPPDelegateCreator, ICPPInternalTemplateInstantiator {
|
||||||
|
|
||||||
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,22 +19,19 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType, ICPPDelegateCreator, IIndexType {
|
class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType, IIndexType {
|
||||||
public CompositeCPPClassType(ICompositesFactory cf, ICPPClassType rbinding) {
|
public CompositeCPPClassType(ICompositesFactory cf, ICPPClassType rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
fail(); return null;
|
fail(); return null;
|
||||||
}
|
}
|
||||||
|
@ -94,6 +91,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone(){
|
public Object clone(){
|
||||||
return new CPPBaseDelegate(base, true);
|
return new CPPBaseDelegate(base, true);
|
||||||
}
|
}
|
||||||
|
@ -176,8 +174,4 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
return ((ICPPClassType)rbinding).isSameType(type);
|
return ((ICPPClassType)rbinding).isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassTypeDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,15 +15,11 @@ import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeration, ICPPDelegateCreator, IIndexType {
|
class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeration, IIndexType {
|
||||||
public CompositeCPPEnumeration(ICompositesFactory cf, IEnumeration rbinding) {
|
public CompositeCPPEnumeration(ICompositesFactory cf, IEnumeration rbinding) {
|
||||||
super(cf, (ICPPBinding) rbinding);
|
super(cf, (ICPPBinding) rbinding);
|
||||||
}
|
}
|
||||||
|
@ -39,9 +35,6 @@ class CompositeCPPEnumeration extends CompositeCPPBinding implements IEnumeratio
|
||||||
return ((IEnumeration)rbinding).isSameType(type);
|
return ((IEnumeration)rbinding).isSameType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() { fail(); return null; }
|
public Object clone() { fail(); return null; }
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPEnumerationDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,10 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumerator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator, ICPPDelegateCreator {
|
class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator {
|
||||||
public CompositeCPPEnumerator(ICompositesFactory cf, IEnumerator rbinding) {
|
public CompositeCPPEnumerator(ICompositesFactory cf, IEnumerator rbinding) {
|
||||||
super(cf, (ICPPBinding) rbinding);
|
super(cf, (ICPPBinding) rbinding);
|
||||||
}
|
}
|
||||||
|
@ -30,8 +26,4 @@ class CompositeCPPEnumerator extends CompositeCPPBinding implements IEnumerator,
|
||||||
IType type = ((IEnumerator)rbinding).getType();
|
IType type = ((IEnumerator)rbinding).getType();
|
||||||
return cf.getCompositeType((IIndexType)type);
|
return cf.getCompositeType((IIndexType)type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,15 +15,11 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IField;
|
import org.eclipse.cdt.core.dom.ast.IField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPField extends CompositeCPPVariable implements ICPPField, ICPPDelegateCreator {
|
class CompositeCPPField extends CompositeCPPVariable implements ICPPField {
|
||||||
public CompositeCPPField(ICompositesFactory cf, ICPPField rbinding) {
|
public CompositeCPPField(ICompositesFactory cf, ICPPField rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
@ -41,8 +37,4 @@ class CompositeCPPField extends CompositeCPPVariable implements ICPPField, ICPPD
|
||||||
IBinding preresult = ((IField)rbinding).getCompositeTypeOwner();
|
IBinding preresult = ((IField)rbinding).getCompositeTypeOwner();
|
||||||
return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
|
return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPField.CPPFieldDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,16 +17,12 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction, ICPPDelegateCreator {
|
class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction {
|
||||||
|
|
||||||
public CompositeCPPFunction(ICompositesFactory cf, ICPPFunction rbinding) {
|
public CompositeCPPFunction(ICompositesFactory cf, ICPPFunction rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
|
@ -81,10 +77,12 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction,
|
||||||
return ((ICPPFunction)rbinding).takesVarArgs();
|
return ((ICPPFunction)rbinding).takesVarArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
fail(); return null;
|
fail(); return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer result = new StringBuffer();
|
StringBuffer result = new StringBuffer();
|
||||||
try {
|
try {
|
||||||
|
@ -94,8 +92,4 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction,
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunction.CPPFunctionDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,19 +13,15 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implements ICPPFunctionTemplate, ICPPInternalTemplateInstantiator, ICPPDelegateCreator {
|
public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implements ICPPFunctionTemplate, ICPPInternalTemplateInstantiator {
|
||||||
|
|
||||||
public CompositeCPPFunctionTemplate(ICompositesFactory cf, ICPPFunction rbinding) {
|
public CompositeCPPFunctionTemplate(ICompositesFactory cf, ICPPFunction rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
|
@ -50,8 +46,4 @@ public class CompositeCPPFunctionTemplate extends CompositeCPPFunction implement
|
||||||
public IBinding instantiate(IType[] arguments) {
|
public IBinding instantiate(IType[] arguments) {
|
||||||
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
|
return InternalTemplateInstantiatorUtil.instantiate(arguments, cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,12 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod, ICPPDelegateCreator {
|
class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod {
|
||||||
|
|
||||||
public CompositeCPPMethod(ICompositesFactory cf, ICPPFunction rbinding) {
|
public CompositeCPPMethod(ICompositesFactory cf, ICPPFunction rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
|
@ -47,8 +43,4 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod, ICP
|
||||||
public int getVisibility() throws DOMException {
|
public int getVisibility() throws DOMException {
|
||||||
return ((ICPPMethod)rbinding).getVisibility();
|
return ((ICPPMethod)rbinding).getVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPMethod.CPPMethodDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,12 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNamespace;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace, ICPPDelegateCreator {
|
class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace {
|
||||||
ICPPNamespace[] namespaces;
|
ICPPNamespace[] namespaces;
|
||||||
public CompositeCPPNamespace(ICompositesFactory cf, ICPPNamespace[] namespaces) {
|
public CompositeCPPNamespace(ICompositesFactory cf, ICPPNamespace[] namespaces) {
|
||||||
super(cf, namespaces[0]);
|
super(cf, namespaces[0]);
|
||||||
|
@ -41,8 +37,4 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace
|
||||||
public ICPPNamespaceScope getNamespaceScope() throws DOMException {
|
public ICPPNamespaceScope getNamespaceScope() throws DOMException {
|
||||||
return new CompositeCPPNamespaceScope(cf, namespaces);
|
return new CompositeCPPNamespaceScope(cf, namespaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,4 @@ class CompositeCPPNamespaceAlias extends CompositeCPPBinding implements ICPPName
|
||||||
IIndexFragmentBinding ns = (IIndexFragmentBinding) ((ICPPNamespaceAlias)rbinding).getBinding();
|
IIndexFragmentBinding ns = (IIndexFragmentBinding) ((ICPPNamespaceAlias)rbinding).getBinding();
|
||||||
return cf.getCompositeBinding(ns);
|
return cf.getCompositeBinding(ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDelegateType() {
|
|
||||||
return NAMESPACE_ALIAS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,15 +10,11 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParameter, ICPPDelegateCreator {
|
class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParameter {
|
||||||
public CompositeCPPParameter(ICompositesFactory cf, ICPPVariable rbinding) {
|
public CompositeCPPParameter(ICompositesFactory cf, ICPPVariable rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
@ -26,8 +22,4 @@ class CompositeCPPParameter extends CompositeCPPVariable implements ICPPParamete
|
||||||
public boolean hasDefaultValue() {
|
public boolean hasDefaultValue() {
|
||||||
return ((ICPPParameter)rbinding).hasDefaultValue();
|
return ((ICPPParameter)rbinding).hasDefaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPParameter.CPPParameterDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,7 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef;
|
|
||||||
import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
|
import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
@ -40,11 +37,8 @@ class CompositeCPPTypedef extends CompositeCPPBinding implements ITypedef, IInde
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return new CPPTypedefClone(this);
|
return new CPPTypedefClone(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPTypedef.CPPTypedefDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,8 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
|
@ -28,19 +26,16 @@ class CompositeCPPUsingDeclaration extends CompositeCPPBinding implements ICPPUs
|
||||||
fail(); return null;
|
fail(); return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate[] getDelegates() throws DOMException {
|
public IBinding[] getDelegates() {
|
||||||
ICPPDelegate[] delegates = ((ICPPUsingDeclaration) rbinding).getDelegates();
|
IBinding[] delegates = ((ICPPUsingDeclaration) rbinding).getDelegates();
|
||||||
ICPPDelegate[] composites = new ICPPDelegate[delegates.length];
|
IBinding[] composites = new IBinding[delegates.length];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (int i = 0; i < delegates.length; i++) {
|
for (int i = 0; i < delegates.length; i++) {
|
||||||
IBinding binding = delegates[i].getBinding();
|
IBinding binding = delegates[i];
|
||||||
if (binding instanceof IIndexFragmentBinding) {
|
if (binding instanceof IIndexFragmentBinding) {
|
||||||
binding = cf.getCompositeBinding((IIndexFragmentBinding) binding);
|
composites[j++] = cf.getCompositeBinding((IIndexFragmentBinding) binding);
|
||||||
if (binding instanceof ICPPDelegateCreator) {
|
|
||||||
composites[j++] = ((ICPPDelegateCreator) binding).createDelegate(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return (IBinding[]) ArrayUtil.trim(IBinding.class, composites);
|
||||||
return (ICPPDelegate[]) ArrayUtil.trim(ICPPDelegate.class, composites);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,11 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable, ICPPDelegateCreator {
|
class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable {
|
||||||
|
|
||||||
public CompositeCPPVariable(ICompositesFactory cf, ICPPVariable delegate) {
|
public CompositeCPPVariable(ICompositesFactory cf, ICPPVariable delegate) {
|
||||||
super(cf, delegate);
|
super(cf, delegate);
|
||||||
|
@ -55,8 +51,4 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable,
|
||||||
public boolean isStatic() throws DOMException {
|
public boolean isStatic() throws DOMException {
|
||||||
return ((ICPPVariable)rbinding).isStatic();
|
return ((ICPPVariable)rbinding).isStatic();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPVariable.CPPVariableDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,11 @@ import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IIndexFileSet;
|
import org.eclipse.cdt.core.index.IIndexFileSet;
|
||||||
import org.eclipse.cdt.core.index.IIndexName;
|
import org.eclipse.cdt.core.index.IIndexName;
|
||||||
|
@ -42,11 +40,9 @@ import org.eclipse.cdt.core.index.IndexFilter;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredClassInstance;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredClassInstance;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||||
|
@ -62,7 +58,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
class PDOMCPPClassTemplate extends PDOMCPPClassType
|
class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
implements ICPPClassTemplate, ICPPInternalTemplateInstantiator,
|
implements ICPPClassTemplate, ICPPInternalTemplateInstantiator,
|
||||||
ICPPTemplateScope, ICPPDelegateCreator {
|
ICPPTemplateScope {
|
||||||
|
|
||||||
private static final int PARAMETERS = PDOMCPPClassType.RECORD_SIZE + 0;
|
private static final int PARAMETERS = PDOMCPPClassType.RECORD_SIZE + 0;
|
||||||
private static final int INSTANCES = PDOMCPPClassType.RECORD_SIZE + 4;
|
private static final int INSTANCES = PDOMCPPClassType.RECORD_SIZE + 4;
|
||||||
|
@ -84,10 +80,12 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
super(pdom, bindingRecord);
|
super(pdom, bindingRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_CLASS_TEMPLATE;
|
return IIndexCPPBindingConstants.CPP_CLASS_TEMPLATE;
|
||||||
}
|
}
|
||||||
|
@ -152,6 +150,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
||||||
try {
|
try {
|
||||||
if (getDBName().equals(name.toCharArray())) {
|
if (getDBName().equals(name.toCharArray())) {
|
||||||
|
@ -163,9 +162,11 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
}
|
}
|
||||||
|
|
||||||
IndexFilter filter = new IndexFilter() {
|
IndexFilter filter = new IndexFilter() {
|
||||||
|
@Override
|
||||||
public boolean acceptBinding(IBinding binding) {
|
public boolean acceptBinding(IBinding binding) {
|
||||||
return !(binding instanceof ICPPTemplateParameter || binding instanceof ICPPSpecialization);
|
return !(binding instanceof ICPPTemplateParameter || binding instanceof ICPPSpecialization);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean acceptLinkage(ILinkage linkage) {
|
public boolean acceptLinkage(ILinkage linkage) {
|
||||||
return linkage.getLinkageID() == ILinkage.CPP_LINKAGE_ID;
|
return linkage.getLinkageID() == ILinkage.CPP_LINKAGE_ID;
|
||||||
}
|
}
|
||||||
|
@ -180,6 +181,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
try {
|
try {
|
||||||
|
@ -190,9 +192,11 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
result = (IBinding[]) ArrayUtil.append(IBinding.class, result, this);
|
result = (IBinding[]) ArrayUtil.append(IBinding.class, result, this);
|
||||||
}
|
}
|
||||||
IndexFilter filter = new IndexFilter() {
|
IndexFilter filter = new IndexFilter() {
|
||||||
|
@Override
|
||||||
public boolean acceptBinding(IBinding binding) {
|
public boolean acceptBinding(IBinding binding) {
|
||||||
return !(binding instanceof ICPPTemplateParameter || binding instanceof ICPPSpecialization);
|
return !(binding instanceof ICPPTemplateParameter || binding instanceof ICPPSpecialization);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean acceptLinkage(ILinkage linkage) {
|
public boolean acceptLinkage(ILinkage linkage) {
|
||||||
return linkage.getLinkageID() == ILinkage.CPP_LINKAGE_ID;
|
return linkage.getLinkageID() == ILinkage.CPP_LINKAGE_ID;
|
||||||
}
|
}
|
||||||
|
@ -268,6 +272,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
|
|
||||||
private PDOMCPPTemplateScope scope;
|
private PDOMCPPTemplateScope scope;
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexScope getParent() {
|
public IIndexScope getParent() {
|
||||||
if (scope == null) {
|
if (scope == null) {
|
||||||
scope = new PDOMCPPTemplateScope();
|
scope = new PDOMCPPTemplateScope();
|
||||||
|
@ -275,6 +280,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void accept(IPDOMVisitor visitor) throws CoreException {
|
public void accept(IPDOMVisitor visitor) throws CoreException {
|
||||||
super.accept(visitor);
|
super.accept(visitor);
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + PARAMETERS, getLinkageImpl());
|
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + PARAMETERS, getLinkageImpl());
|
||||||
|
@ -283,6 +289,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
list.accept(visitor);
|
list.accept(visitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addMember(PDOMNode member) throws CoreException {
|
public void addMember(PDOMNode member) throws CoreException {
|
||||||
if (member instanceof ICPPTemplateParameter) {
|
if (member instanceof ICPPTemplateParameter) {
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + PARAMETERS, getLinkageImpl());
|
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + PARAMETERS, getLinkageImpl());
|
||||||
|
@ -370,6 +377,7 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if (type instanceof ITypedef) {
|
if (type instanceof ITypedef) {
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
|
@ -420,8 +428,4 @@ class PDOMCPPClassTemplate extends PDOMCPPClassType
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPClassTemplate.CPPClassTemplateDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IIndexFileSet;
|
import org.eclipse.cdt.core.index.IIndexFileSet;
|
||||||
import org.eclipse.cdt.core.index.IndexFilter;
|
import org.eclipse.cdt.core.index.IndexFilter;
|
||||||
|
@ -47,8 +45,6 @@ import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassScope;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeDelegate;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
|
@ -67,7 +63,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope, ICPPDelegateCreator {
|
ICPPClassScope, IPDOMMemberOwner, IIndexType, IIndexScope {
|
||||||
|
|
||||||
@SuppressWarnings("static-access")
|
@SuppressWarnings("static-access")
|
||||||
private static final int FIRSTBASE = PDOMCPPBinding.RECORD_SIZE + 0;
|
private static final int FIRSTBASE = PDOMCPPBinding.RECORD_SIZE + 0;
|
||||||
|
@ -90,6 +86,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
super(pdom, bindingRecord);
|
super(pdom, bindingRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof ICPPClassType) {
|
if (newBinding instanceof ICPPClassType) {
|
||||||
ICPPClassType ct= (ICPPClassType) newBinding;
|
ICPPClassType ct= (ICPPClassType) newBinding;
|
||||||
|
@ -111,10 +108,12 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
list.addMember(member);
|
list.addMember(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPCLASSTYPE;
|
return IIndexCPPBindingConstants.CPPCLASSTYPE;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +135,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if (type instanceof ITypedef || type instanceof ICPPDelegate) {
|
if (type instanceof ITypedef) {
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +175,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void accept(IPDOMVisitor visitor) throws CoreException {
|
public void accept(IPDOMVisitor visitor) throws CoreException {
|
||||||
super.accept(visitor);
|
super.accept(visitor);
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + MEMBERLIST, getLinkageImpl());
|
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + MEMBERLIST, getLinkageImpl());
|
||||||
|
@ -304,6 +304,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
try {
|
try {
|
||||||
return getParentNode() instanceof PDOMLinkage;
|
return getParentNode() instanceof PDOMLinkage;
|
||||||
|
@ -316,6 +317,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addChild(PDOMNode member) throws CoreException {
|
public void addChild(PDOMNode member) throws CoreException {
|
||||||
addMember(member);
|
addMember(member);
|
||||||
}
|
}
|
||||||
|
@ -335,6 +337,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
||||||
try {
|
try {
|
||||||
final char[] nameChars = name.toCharArray();
|
final char[] nameChars = name.toCharArray();
|
||||||
|
@ -354,6 +357,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
try {
|
try {
|
||||||
|
@ -399,10 +403,12 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
|
|
||||||
// Not implemented
|
// Not implemented
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {fail();return null;}
|
public Object clone() {fail();return null;}
|
||||||
public IField findField(String name) throws DOMException {fail();return null;}
|
public IField findField(String name) throws DOMException {fail();return null;}
|
||||||
public IBinding[] getFriends() throws DOMException {fail();return null;}
|
public IBinding[] getFriends() throws DOMException {fail();return null;}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean mayHaveChildren() {
|
public boolean mayHaveChildren() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -434,10 +440,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements ICPPClassType,
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
@Override
|
||||||
return new CPPClassTypeDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ASTTypeUtil.getType(this);
|
return ASTTypeUtil.getType(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration.CPPEnumerationDelegate;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
|
@ -38,7 +34,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
class PDOMCPPEnumeration extends PDOMCPPBinding
|
class PDOMCPPEnumeration extends PDOMCPPBinding
|
||||||
implements IEnumeration, IIndexType, ICPPBinding, ICPPDelegateCreator {
|
implements IEnumeration, IIndexType, ICPPBinding {
|
||||||
|
|
||||||
private static final int FIRST_ENUMERATOR = PDOMBinding.RECORD_SIZE + 0;
|
private static final int FIRST_ENUMERATOR = PDOMBinding.RECORD_SIZE + 0;
|
||||||
|
|
||||||
|
@ -54,10 +50,12 @@ class PDOMCPPEnumeration extends PDOMCPPBinding
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPENUMERATION;
|
return IIndexCPPBindingConstants.CPPENUMERATION;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +98,7 @@ class PDOMCPPEnumeration extends PDOMCPPBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if (type instanceof ITypedef || type instanceof ICPPDelegate) {
|
if (type instanceof ITypedef) {
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,12 +129,8 @@ class PDOMCPPEnumeration extends PDOMCPPBinding
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPEnumerationDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumerator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||||
|
@ -30,7 +26,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBinding, ICPPDelegateCreator {
|
class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBinding {
|
||||||
|
|
||||||
private static final int ENUMERATION = PDOMBinding.RECORD_SIZE + 0;
|
private static final int ENUMERATION = PDOMBinding.RECORD_SIZE + 0;
|
||||||
private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4;
|
private static final int NEXT_ENUMERATOR = PDOMBinding.RECORD_SIZE + 4;
|
||||||
|
@ -49,10 +45,12 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPENUMERATOR;
|
return IIndexCPPBindingConstants.CPPENUMERATOR;
|
||||||
}
|
}
|
||||||
|
@ -75,9 +73,4 @@ class PDOMCPPEnumerator extends PDOMCPPBinding implements IEnumerator, ICPPBindi
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPEnumerator.CPPEnumeratorDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,7 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||||
|
@ -30,7 +26,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCreator {
|
class PDOMCPPField extends PDOMCPPVariable implements ICPPField {
|
||||||
|
|
||||||
public PDOMCPPField(PDOM pdom, PDOMNode parent, ICPPField field)
|
public PDOMCPPField(PDOM pdom, PDOMNode parent, ICPPField field)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
@ -42,11 +38,13 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPFIELD;
|
return IIndexCPPBindingConstants.CPPFIELD;
|
||||||
}
|
}
|
||||||
|
@ -65,28 +63,33 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public boolean isMutable() {
|
public boolean isMutable() {
|
||||||
return getBit(getByte(record + ANNOTATIONS), PDOMCPPAnnotation.MUTABLE_OFFSET);
|
return getBit(getByte(record + ANNOTATIONS), PDOMCPPAnnotation.MUTABLE_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public boolean isAuto() {
|
public boolean isAuto() {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public boolean isExtern() {
|
public boolean isExtern() {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public boolean isExternC() {
|
public boolean isExternC() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@Override
|
||||||
public boolean isRegister() {
|
public boolean isRegister() {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
|
@ -95,9 +98,4 @@ class PDOMCPPField extends PDOMCPPVariable implements ICPPField, ICPPDelegateCre
|
||||||
public ICompositeType getCompositeTypeOwner() {
|
public ICompositeType getCompositeTypeOwner() {
|
||||||
return getClassOwner();
|
return getClassOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPField.CPPFieldDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,9 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil;
|
import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
|
@ -45,7 +41,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverloader, ICPPDelegateCreator {
|
class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverloader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset of total number of function parameters (relative to the
|
* Offset of total number of function parameters (relative to the
|
||||||
|
@ -108,6 +104,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
||||||
setParameters(pft, params);
|
setParameters(pft, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof ICPPFunction) {
|
if (newBinding instanceof ICPPFunction) {
|
||||||
IFunction func= (ICPPFunction) newBinding;
|
IFunction func= (ICPPFunction) newBinding;
|
||||||
|
@ -164,10 +161,12 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
||||||
super(pdom, bindingRecord);
|
super(pdom, bindingRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPFUNCTION;
|
return IIndexCPPBindingConstants.CPPFUNCTION;
|
||||||
}
|
}
|
||||||
|
@ -248,15 +247,18 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
||||||
return getBit(getByte(record + ANNOTATION), PDOMCAnnotation.VARARGS_OFFSET);
|
return getBit(getByte(record + ANNOTATION), PDOMCAnnotation.VARARGS_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int pdomCompareTo(PDOMBinding other) {
|
public int pdomCompareTo(PDOMBinding other) {
|
||||||
int cmp= super.pdomCompareTo(other);
|
int cmp= super.pdomCompareTo(other);
|
||||||
return cmp==0 ? compareSignatures(this, other) : cmp;
|
return cmp==0 ? compareSignatures(this, other) : cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer result = new StringBuffer();
|
StringBuffer result = new StringBuffer();
|
||||||
result.append(getName()+" "+ASTTypeUtil.getParameterTypeString(getType())); //$NON-NLS-1$
|
result.append(getName()+" "+ASTTypeUtil.getParameterTypeString(getType())); //$NON-NLS-1$
|
||||||
|
@ -283,9 +285,4 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunction.CPPFunctionDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
|
@ -29,15 +28,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IIndexFileSet;
|
import org.eclipse.cdt.core.index.IIndexFileSet;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredFunctionInstance;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPDeferredFunctionInstance;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplates;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalTemplateInstantiator;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||||
|
@ -55,7 +51,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
ICPPFunctionTemplate, ICPPInternalTemplateInstantiator,
|
ICPPFunctionTemplate, ICPPInternalTemplateInstantiator,
|
||||||
IPDOMMemberOwner, ICPPTemplateScope, IIndexScope, ICPPDelegateCreator {
|
IPDOMMemberOwner, ICPPTemplateScope, IIndexScope {
|
||||||
|
|
||||||
private static final int TEMPLATE_PARAMS = PDOMCPPFunction.RECORD_SIZE + 0;
|
private static final int TEMPLATE_PARAMS = PDOMCPPFunction.RECORD_SIZE + 0;
|
||||||
private static final int INSTANCES = PDOMCPPFunction.RECORD_SIZE + 4;
|
private static final int INSTANCES = PDOMCPPFunction.RECORD_SIZE + 4;
|
||||||
|
@ -76,14 +72,17 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
super(pdom, bindingRecord);
|
super(pdom, bindingRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(PDOMLinkage linkage, IBinding name) {
|
public void update(PDOMLinkage linkage, IBinding name) {
|
||||||
// no support for updating templates, yet.
|
// no support for updating templates, yet.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_FUNCTION_TEMPLATE;
|
return IIndexCPPBindingConstants.CPP_FUNCTION_TEMPLATE;
|
||||||
}
|
}
|
||||||
|
@ -170,6 +169,7 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
return CPPTemplates.instantiateTemplate(this, arguments, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addChild(PDOMNode child) throws CoreException {
|
public void addChild(PDOMNode child) throws CoreException {
|
||||||
addMember(child);
|
addMember(child);
|
||||||
}
|
}
|
||||||
|
@ -187,6 +187,7 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void accept(IPDOMVisitor visitor) throws CoreException {
|
public void accept(IPDOMVisitor visitor) throws CoreException {
|
||||||
super.accept(visitor);
|
super.accept(visitor);
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TEMPLATE_PARAMS, getLinkageImpl());
|
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TEMPLATE_PARAMS, getLinkageImpl());
|
||||||
|
@ -203,6 +204,7 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
return CPPSemantics.findBindings( this, name, false );
|
return CPPSemantics.findBindings( this, name, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet)
|
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet)
|
||||||
throws DOMException {
|
throws DOMException {
|
||||||
try {
|
try {
|
||||||
|
@ -217,6 +219,7 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
|
||||||
throws DOMException {
|
throws DOMException {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
|
@ -234,9 +237,4 @@ class PDOMCPPFunctionTemplate extends PDOMCPPFunction implements
|
||||||
public IIndexBinding getScopeBinding() {
|
public IIndexBinding getScopeBinding() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPFunctionTemplate.CPPFunctionTemplateDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredTemplateInstance;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
|
@ -198,6 +197,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
|
|
||||||
List<Runnable> postProcesses = new ArrayList<Runnable>();
|
List<Runnable> postProcesses = new ArrayList<Runnable>();
|
||||||
|
|
||||||
|
@Override
|
||||||
public PDOMBinding addBinding(IASTName name) throws CoreException {
|
public PDOMBinding addBinding(IASTName name) throws CoreException {
|
||||||
if (name == null || name instanceof ICPPASTQualifiedName)
|
if (name == null || name instanceof ICPPASTQualifiedName)
|
||||||
return null;
|
return null;
|
||||||
|
@ -230,14 +230,13 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
return pdomBinding;
|
return pdomBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PDOMBinding addBinding(IBinding binding, IASTName fromName) throws CoreException {
|
public PDOMBinding addBinding(IBinding binding, IASTName fromName) throws CoreException {
|
||||||
// assign names to anonymous types.
|
// assign names to anonymous types.
|
||||||
binding= PDOMASTAdapter.getAdapterForAnonymousASTBinding(binding);
|
binding= PDOMASTAdapter.getAdapterForAnonymousASTBinding(binding);
|
||||||
if (binding == null) {
|
if (binding == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// references to the using-declarations delegates are stored with the original binding.
|
|
||||||
binding = unwrapUsingDelarationDelegates(binding);
|
|
||||||
|
|
||||||
PDOMBinding pdomBinding = adaptBinding(binding);
|
PDOMBinding pdomBinding = adaptBinding(binding);
|
||||||
if (pdomBinding != null) {
|
if (pdomBinding != null) {
|
||||||
|
@ -261,18 +260,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
return pdomBinding;
|
return pdomBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IBinding unwrapUsingDelarationDelegates(IBinding binding) {
|
|
||||||
while (binding instanceof ICPPDelegate) {
|
|
||||||
ICPPDelegate d= (ICPPDelegate) binding;
|
|
||||||
if (d.getDelegateType() == ICPPDelegate.USING_DECLARATION) {
|
|
||||||
binding= d.getBinding();
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addConstructors(PDOMBinding pdomBinding, ICPPClassType binding)
|
private void addConstructors(PDOMBinding pdomBinding, ICPPClassType binding)
|
||||||
throws DOMException, CoreException {
|
throws DOMException, CoreException {
|
||||||
ICPPConstructor[] constructors = binding.getConstructors();
|
ICPPConstructor[] constructors = binding.getConstructors();
|
||||||
|
@ -582,9 +569,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PDOMBinding doAdaptBinding(IBinding binding) throws CoreException {
|
public PDOMBinding doAdaptBinding(IBinding binding) throws CoreException {
|
||||||
// references to using-declarations are stored with the original binding.
|
|
||||||
binding= unwrapUsingDelarationDelegates(binding);
|
|
||||||
|
|
||||||
PDOMNode parent = getAdaptedParent(binding, false);
|
PDOMNode parent = getAdaptedParent(binding, false);
|
||||||
if (parent == this) {
|
if (parent == this) {
|
||||||
int localToFileRec= getLocalToFileRec(null, binding);
|
int localToFileRec= getLocalToFileRec(null, binding);
|
||||||
|
@ -857,6 +841,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBTreeComparator getIndexComparator() {
|
public IBTreeComparator getIndexComparator() {
|
||||||
return new CPPFindBinding.CPPBindingBTreeComparator(pdom);
|
return new CPPFindBinding.CPPBindingBTreeComparator(pdom);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,13 +25,9 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
|
@ -46,7 +42,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateCreator {
|
class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset of remaining annotation information (relative to the beginning of
|
* Offset of remaining annotation information (relative to the beginning of
|
||||||
|
@ -82,6 +78,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof ICPPMethod) {
|
if (newBinding instanceof ICPPMethod) {
|
||||||
ICPPMethod method= (ICPPMethod) newBinding;
|
ICPPMethod method= (ICPPMethod) newBinding;
|
||||||
|
@ -94,10 +91,12 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPMETHOD;
|
return IIndexCPPBindingConstants.CPPMETHOD;
|
||||||
}
|
}
|
||||||
|
@ -110,6 +109,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.DESTRUCTOR_OFFSET);
|
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.DESTRUCTOR_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isMutable() throws DOMException {
|
public boolean isMutable() throws DOMException {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
@ -118,24 +118,29 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IScope getFunctionScope() throws DOMException {
|
public IScope getFunctionScope() throws DOMException {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isExtern() throws DOMException {
|
public boolean isExtern() throws DOMException {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isExternC() {
|
public boolean isExternC() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isAuto() throws DOMException {
|
public boolean isAuto() throws DOMException {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isRegister() throws DOMException {
|
public boolean isRegister() throws DOMException {
|
||||||
// ISO/IEC 14882:2003 9.2.6
|
// ISO/IEC 14882:2003 9.2.6
|
||||||
return false;
|
return false;
|
||||||
|
@ -154,6 +159,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
@ -166,10 +172,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod, ICPPDelegateC
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCAnnotation.VOLATILE_OFFSET + CV_OFFSET);
|
return getBit(getByte(record + ANNOTATION1), PDOMCAnnotation.VOLATILE_OFFSET + CV_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
@Override
|
||||||
return new CPPMethod.CPPMethodDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAdditionalNameFlags(int standardFlags, IASTName name) {
|
public int getAdditionalNameFlags(int standardFlags, IASTName name) {
|
||||||
if ((standardFlags & PDOMName.IS_REFERENCE) == PDOMName.IS_REFERENCE) {
|
if ((standardFlags & PDOMName.IS_REFERENCE) == PDOMName.IS_REFERENCE) {
|
||||||
IASTNode parent= name.getParent();
|
IASTNode parent= name.getParent();
|
||||||
|
|
|
@ -21,18 +21,14 @@ import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||||
import org.eclipse.cdt.core.index.IIndexFileSet;
|
import org.eclipse.cdt.core.index.IIndexFileSet;
|
||||||
import org.eclipse.cdt.core.index.IndexFilter;
|
import org.eclipse.cdt.core.index.IndexFilter;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNamespace;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
|
@ -48,7 +44,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPNamespace extends PDOMCPPBinding
|
class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
implements ICPPNamespace, ICPPNamespaceScope, IIndexScope, ICPPDelegateCreator {
|
implements ICPPNamespace, ICPPNamespaceScope, IIndexScope {
|
||||||
|
|
||||||
private static final int INDEX_OFFSET = PDOMBinding.RECORD_SIZE + 0;
|
private static final int INDEX_OFFSET = PDOMBinding.RECORD_SIZE + 0;
|
||||||
|
|
||||||
|
@ -63,10 +59,12 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPNAMESPACE;
|
return IIndexCPPBindingConstants.CPPNAMESPACE;
|
||||||
}
|
}
|
||||||
|
@ -75,6 +73,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
return new BTree(pdom.getDB(), record + INDEX_OFFSET, getLinkageImpl().getIndexComparator());
|
return new BTree(pdom.getDB(), record + INDEX_OFFSET, getLinkageImpl().getIndexComparator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void accept(final IPDOMVisitor visitor) throws CoreException {
|
public void accept(final IPDOMVisitor visitor) throws CoreException {
|
||||||
if (visitor instanceof IBTreeVisitor) {
|
if (visitor instanceof IBTreeVisitor) {
|
||||||
getIndex().accept((IBTreeVisitor) visitor);
|
getIndex().accept((IBTreeVisitor) visitor);
|
||||||
|
@ -97,6 +96,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addChild(PDOMNode child) throws CoreException {
|
public void addChild(PDOMNode child) throws CoreException {
|
||||||
getIndex().insert(child.getRecord());
|
getIndex().insert(child.getRecord());
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
return IIndexBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
|
||||||
try {
|
try {
|
||||||
IBinding[] bindings= getBindingsViaCache(name.toCharArray());
|
IBinding[] bindings= getBindingsViaCache(name.toCharArray());
|
||||||
|
@ -133,6 +134,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
try {
|
try {
|
||||||
|
@ -169,6 +171,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean mayHaveChildren() {
|
public boolean mayHaveChildren() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -198,9 +201,4 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
public IIndexBinding getScopeBinding() {
|
public IIndexBinding getScopeBinding() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPNamespace.CPPNamespaceDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof ICPPNamespaceAlias) {
|
if (newBinding instanceof ICPPNamespaceAlias) {
|
||||||
ICPPNamespaceAlias alias= (ICPPNamespaceAlias) newBinding;
|
ICPPNamespaceAlias alias= (ICPPNamespaceAlias) newBinding;
|
||||||
|
@ -64,10 +65,12 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias
|
||||||
namespace != null ? namespace.getRecord() : 0);
|
namespace != null ? namespace.getRecord() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPNAMESPACEALIAS;
|
return IIndexCPPBindingConstants.CPPNAMESPACEALIAS;
|
||||||
}
|
}
|
||||||
|
@ -95,10 +98,6 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDelegateType() {
|
|
||||||
return NAMESPACE_ALIAS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IBinding getBinding() {
|
public IBinding getBinding() {
|
||||||
try {
|
try {
|
||||||
return (IBinding) getLinkageImpl().getNode(getPDOM().getDB().getInt(record + NAMESPACE_BINDING));
|
return (IBinding) getLinkageImpl().getNode(getPDOM().getDB().getInt(record + NAMESPACE_BINDING));
|
||||||
|
|
|
@ -17,13 +17,9 @@ import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexFile;
|
import org.eclipse.cdt.core.index.IIndexFile;
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPParameter;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragment;
|
import org.eclipse.cdt.internal.core.index.IIndexFragment;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
|
@ -42,7 +38,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
class PDOMCPPParameter extends PDOMNamedNode
|
class PDOMCPPParameter extends PDOMNamedNode
|
||||||
implements ICPPParameter, IIndexFragmentBinding, ICPPDelegateCreator {
|
implements ICPPParameter, IIndexFragmentBinding {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset of pointer to the next parameter (relative to the
|
* Offset of pointer to the next parameter (relative to the
|
||||||
|
@ -119,10 +115,12 @@ class PDOMCPPParameter extends PDOMNamedNode
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPPARAMETER;
|
return IIndexCPPBindingConstants.CPPPARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -199,6 +197,7 @@ class PDOMCPPParameter extends PDOMNamedNode
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
try {
|
try {
|
||||||
return super.getNameCharArray();
|
return super.getNameCharArray();
|
||||||
|
@ -244,10 +243,7 @@ class PDOMCPPParameter extends PDOMNamedNode
|
||||||
return getNodeType();
|
return getNodeType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
@Override
|
||||||
return new CPPParameter.CPPParameterDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void delete(PDOMLinkage linkage) throws CoreException {
|
public void delete(PDOMLinkage linkage) throws CoreException {
|
||||||
linkage.deleteType(getType(), record);
|
linkage.deleteType(getType(), record);
|
||||||
PDOMCPPParameter next= getNextParameter();
|
PDOMCPPParameter next= getNextParameter();
|
||||||
|
|
|
@ -17,13 +17,9 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTypedef;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
|
import org.eclipse.cdt.internal.core.index.CPPTypedefClone;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
|
@ -37,7 +33,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
class PDOMCPPTypedef extends PDOMCPPBinding
|
class PDOMCPPTypedef extends PDOMCPPBinding
|
||||||
implements ITypedef, ITypeContainer, IIndexType, ICPPDelegateCreator {
|
implements ITypedef, ITypeContainer, IIndexType {
|
||||||
|
|
||||||
private static final int TYPE = PDOMBinding.RECORD_SIZE + 0;
|
private static final int TYPE = PDOMBinding.RECORD_SIZE + 0;
|
||||||
|
|
||||||
|
@ -58,6 +54,7 @@ class PDOMCPPTypedef extends PDOMCPPBinding
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof ITypedef) {
|
if (newBinding instanceof ITypedef) {
|
||||||
ITypedef td= (ITypedef) newBinding;
|
ITypedef td= (ITypedef) newBinding;
|
||||||
|
@ -114,10 +111,12 @@ class PDOMCPPTypedef extends PDOMCPPBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPTYPEDEF;
|
return IIndexCPPBindingConstants.CPPTYPEDEF;
|
||||||
}
|
}
|
||||||
|
@ -152,12 +151,8 @@ class PDOMCPPTypedef extends PDOMCPPBinding
|
||||||
|
|
||||||
public void setType(IType type) { fail(); }
|
public void setType(IType type) { fail(); }
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return new CPPTypedefClone(this);
|
return new CPPTypedefClone(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
|
||||||
return new CPPTypedef.CPPTypedefDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,9 @@
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
|
||||||
|
@ -40,18 +37,12 @@ class PDOMCPPUsingDeclaration extends PDOMCPPBinding implements ICPPUsingDeclara
|
||||||
private static final int NEXT_DELEGATE = PDOMCPPBinding.RECORD_SIZE + 4;
|
private static final int NEXT_DELEGATE = PDOMCPPBinding.RECORD_SIZE + 4;
|
||||||
@SuppressWarnings({ "hiding", "static-access" })
|
@SuppressWarnings({ "hiding", "static-access" })
|
||||||
protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 8;
|
protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE + 8;
|
||||||
private ICPPDelegate[] delegates;
|
private IBinding[] delegates;
|
||||||
|
|
||||||
public PDOMCPPUsingDeclaration(PDOM pdom, PDOMNode parent, ICPPUsingDeclaration using)
|
public PDOMCPPUsingDeclaration(PDOM pdom, PDOMNode parent, ICPPUsingDeclaration using)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
super(pdom, parent, using.getNameCharArray());
|
super(pdom, parent, using.getNameCharArray());
|
||||||
ICPPDelegate[] delegates;
|
IBinding[] delegates= using.getDelegates();
|
||||||
try {
|
|
||||||
delegates = using.getDelegates();
|
|
||||||
} catch (DOMException e) {
|
|
||||||
CCorePlugin.log(e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int nextRecord = 0;
|
int nextRecord = 0;
|
||||||
for (int i = delegates.length; --i >= 0;) {
|
for (int i = delegates.length; --i >= 0;) {
|
||||||
PDOMCPPUsingDeclaration simpleUsing = i > 0 ?
|
PDOMCPPUsingDeclaration simpleUsing = i > 0 ?
|
||||||
|
@ -70,36 +61,37 @@ class PDOMCPPUsingDeclaration extends PDOMCPPBinding implements ICPPUsingDeclara
|
||||||
super(pdom, parent, name);
|
super(pdom, parent, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTargetBinding(PDOMLinkage linkage, ICPPDelegate delegate) throws CoreException {
|
private void setTargetBinding(PDOMLinkage linkage, IBinding delegate) throws CoreException {
|
||||||
PDOMBinding target = getLinkageImpl().adaptBinding(delegate.getBinding());
|
PDOMBinding target = getLinkageImpl().adaptBinding(delegate);
|
||||||
pdom.getDB().putInt(record + TARGET_BINDING, target != null ? target.getRecord() : 0);
|
pdom.getDB().putInt(record + TARGET_BINDING, target != null ? target.getRecord() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_USING_DECLARATION;
|
return IIndexCPPBindingConstants.CPP_USING_DECLARATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate[] getDelegates() {
|
public IBinding[] getDelegates() {
|
||||||
if (delegates == null) {
|
if (delegates == null) {
|
||||||
delegates = new ICPPDelegate[1];
|
delegates = new IBinding[1];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
PDOMCPPUsingDeclaration alias = this;
|
PDOMCPPUsingDeclaration alias = this;
|
||||||
try {
|
try {
|
||||||
do {
|
do {
|
||||||
IBinding binding = alias.getBinding();
|
IBinding delegate = alias.getBinding();
|
||||||
if (binding instanceof ICPPDelegateCreator) {
|
if (delegate != null) {
|
||||||
ICPPDelegate delegate = ((ICPPDelegateCreator) binding).createDelegate(this);
|
delegates= (IBinding[]) ArrayUtil.append(IBinding.class, delegates, i++, delegate);
|
||||||
delegates= (ICPPDelegate[]) ArrayUtil.append(ICPPDelegate.class, delegates, i++, delegate);
|
|
||||||
}
|
}
|
||||||
} while ((alias = alias.getNext()) != null);
|
} while ((alias = alias.getNext()) != null);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
delegates = (ICPPDelegate[]) ArrayUtil.trim(ICPPDelegate.class, delegates);
|
delegates = (IBinding[]) ArrayUtil.trim(IBinding.class, delegates);
|
||||||
}
|
}
|
||||||
return delegates;
|
return delegates;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,8 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IVariable;
|
import org.eclipse.cdt.core.dom.ast.IVariable;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
import org.eclipse.cdt.internal.core.Util;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDelegateCreator;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
|
@ -39,7 +35,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelegateCreator {
|
class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset of pointer to type information for this parameter
|
* Offset of pointer to type information for this parameter
|
||||||
|
@ -72,6 +68,7 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
public void update(final PDOMLinkage linkage, IBinding newBinding) throws CoreException {
|
||||||
if (newBinding instanceof IVariable) {
|
if (newBinding instanceof IVariable) {
|
||||||
IVariable var= (IVariable) newBinding;
|
IVariable var= (IVariable) newBinding;
|
||||||
|
@ -103,10 +100,12 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega
|
||||||
super(pdom, record);
|
super(pdom, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int getRecordSize() {
|
protected int getRecordSize() {
|
||||||
return RECORD_SIZE;
|
return RECORD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPPVARIABLE;
|
return IIndexCPPBindingConstants.CPPVARIABLE;
|
||||||
}
|
}
|
||||||
|
@ -146,10 +145,7 @@ class PDOMCPPVariable extends PDOMCPPBinding implements ICPPVariable, ICPPDelega
|
||||||
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
|
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPDelegate createDelegate(ICPPUsingDeclaration usingDecl) {
|
@Override
|
||||||
return new CPPVariable.CPPVariableDelegate(usingDecl, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAdditionalNameFlags(int standardFlags, IASTName name) {
|
public int getAdditionalNameFlags(int standardFlags, IASTName name) {
|
||||||
if ((standardFlags & PDOMName.IS_REFERENCE) == PDOMName.IS_REFERENCE) {
|
if ((standardFlags & PDOMName.IS_REFERENCE) == PDOMName.IS_REFERENCE) {
|
||||||
return CPPVariableReadWriteFlags.getReadWriteFlags(name);
|
return CPPVariableReadWriteFlags.getReadWriteFlags(name);
|
||||||
|
|
|
@ -349,7 +349,6 @@ public class BaseUITestCase extends BaseTestCase {
|
||||||
}
|
}
|
||||||
runEventQueue(10);
|
runEventQueue(10);
|
||||||
}
|
}
|
||||||
runEventQueue(30000);
|
|
||||||
fail("Timeout expired waiting for tree node " + label + "{" + i0 + "," + i1 + "}");
|
fail("Timeout expired waiting for tree node " + label + "{" + i0 + "," + i1 + "}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.ui.tests.callhierarchy;
|
package org.eclipse.cdt.ui.tests.callhierarchy;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -659,7 +658,7 @@ public class BasicCallHierarchyTest extends CallHierarchyBaseTest {
|
||||||
|
|
||||||
i1= checkTreeNode(tree, 0, 0, "gf()"); // sf()[f1] <- gf()
|
i1= checkTreeNode(tree, 0, 0, "gf()"); // sf()[f1] <- gf()
|
||||||
i2= checkTreeNode(tree, 0, 1, "sf()"); // sf()[f1] <- sf()[f1]
|
i2= checkTreeNode(tree, 0, 1, "sf()"); // sf()[f1] <- sf()[f1]
|
||||||
checkTreeNode(i0, 2, null);
|
checkTreeNode(tree, 0, 2, null);
|
||||||
|
|
||||||
expandTreeItem(i1);
|
expandTreeItem(i1);
|
||||||
expandTreeItem(i2);
|
expandTreeItem(i2);
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
package org.eclipse.cdt.internal.ui.search.actions;
|
package org.eclipse.cdt.internal.ui.search.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
@ -92,6 +95,7 @@ public class OpenDeclarationsAction extends SelectionParseAction {
|
||||||
super(CEditorMessages.getString("OpenDeclarations.dialog.title")); //$NON-NLS-1$
|
super(CEditorMessages.getString("OpenDeclarations.dialog.title")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
try {
|
try {
|
||||||
clearStatusLine();
|
clearStatusLine();
|
||||||
|
@ -337,45 +341,20 @@ public class OpenDeclarationsAction extends SelectionParseAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
private IName[] findDefinitions(IIndex index, IASTTranslationUnit ast, int isKind, IBinding binding) throws CoreException {
|
private IName[] findDefinitions(IIndex index, IASTTranslationUnit ast, int isKind, IBinding binding) throws CoreException {
|
||||||
IASTName[] declNames= ast.getDefinitionsInAST(binding);
|
List<IASTName> declNames= new ArrayList<IASTName>();
|
||||||
boolean containsUsingDirectives= false;
|
declNames.addAll(Arrays.asList(ast.getDefinitionsInAST(binding)));
|
||||||
for (int i = 0; i < declNames.length; i++) {
|
for (Iterator<IASTName> i = declNames.iterator(); i.hasNext();) {
|
||||||
IASTName name= declNames[i];
|
IASTName name= i.next();
|
||||||
if (name.resolveBinding() instanceof ICPPUsingDeclaration) {
|
if (name.resolveBinding() instanceof ICPPUsingDeclaration) {
|
||||||
containsUsingDirectives= true;
|
i.remove();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (containsUsingDirectives) {
|
if (!declNames.isEmpty()) {
|
||||||
// prevent navigation from using-decl to itself, or prefer using-decls over original defs.
|
return declNames.toArray(new IASTName[declNames.size()]);
|
||||||
declNames= separateUsingDecls(declNames, isKind != KIND_USING_DECL);
|
|
||||||
}
|
|
||||||
if (declNames.length > 0) {
|
|
||||||
return declNames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Try definition in index
|
// 2. Try definition in index
|
||||||
IIndexName[] inames= index.findNames(binding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACCROSS_LANGUAGE_BOUNDARIES);
|
return index.findNames(binding, IIndex.FIND_DEFINITIONS | IIndex.SEARCH_ACCROSS_LANGUAGE_BOUNDARIES);
|
||||||
if (isKind != KIND_USING_DECL) {
|
|
||||||
// prefer using decls
|
|
||||||
for (int i = 0; i < inames.length; i++) {
|
|
||||||
if (index.findBinding(inames[i]) instanceof ICPPUsingDeclaration) {
|
|
||||||
return new IName[]{inames[i]};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return inames;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IASTName[] separateUsingDecls(IASTName[] declNames, boolean keep) {
|
|
||||||
ArrayList<IASTName> result= new ArrayList<IASTName>(declNames.length);
|
|
||||||
for (int i = 0; i < declNames.length; i++) {
|
|
||||||
IASTName name = declNames[i];
|
|
||||||
if (keep == (name.resolveBinding() instanceof ICPPUsingDeclaration)) {
|
|
||||||
result.add(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result.toArray(new IASTName[result.size()]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IName[] findDeclarations(IIndex index, IASTTranslationUnit ast,
|
private IName[] findDeclarations(IIndex index, IASTTranslationUnit ast,
|
||||||
|
@ -394,6 +373,7 @@ public class OpenDeclarationsAction extends SelectionParseAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
selNode = getSelectedStringFromEditor();
|
selNode = getSelectedStringFromEditor();
|
||||||
if (selNode != null) {
|
if (selNode != null) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 QNX Software Systems and others.
|
* Copyright (c) 2007, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -49,7 +49,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDelegate;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
||||||
|
@ -81,11 +80,12 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
public DOMCompletionProposalComputer() {
|
public DOMCompletionProposalComputer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List computeCompletionProposals(
|
@Override
|
||||||
|
protected List<CCompletionProposal> computeCompletionProposals(
|
||||||
CContentAssistInvocationContext context,
|
CContentAssistInvocationContext context,
|
||||||
IASTCompletionNode completionNode, String prefix) {
|
IASTCompletionNode completionNode, String prefix) {
|
||||||
|
|
||||||
List proposals = new ArrayList();
|
List<CCompletionProposal> proposals = new ArrayList<CCompletionProposal>();
|
||||||
|
|
||||||
if(inPreprocessorDirective(context)) {
|
if(inPreprocessorDirective(context)) {
|
||||||
// add only macros
|
// add only macros
|
||||||
|
@ -145,7 +145,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addMacroProposals(CContentAssistInvocationContext context, String prefix, List proposals) {
|
private void addMacroProposals(CContentAssistInvocationContext context, String prefix, List<CCompletionProposal> proposals) {
|
||||||
char[] prefixChars= prefix.toCharArray();
|
char[] prefixChars= prefix.toCharArray();
|
||||||
IASTCompletionNode completionNode = context.getCompletionNode();
|
IASTCompletionNode completionNode = context.getCompletionNode();
|
||||||
IASTPreprocessorMacroDefinition[] macros = completionNode.getTranslationUnit().getMacroDefinitions();
|
IASTPreprocessorMacroDefinition[] macros = completionNode.getTranslationUnit().getMacroDefinitions();
|
||||||
|
@ -160,7 +160,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
handleMacro(macros[i], context, proposals);
|
handleMacro(macros[i], context, proposals);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMacro(IASTPreprocessorMacroDefinition macro, CContentAssistInvocationContext context, List proposals) {
|
private void handleMacro(IASTPreprocessorMacroDefinition macro, CContentAssistInvocationContext context, List<CCompletionProposal> proposals) {
|
||||||
String macroName = macro.getName().toString();
|
String macroName = macro.getName().toString();
|
||||||
Image image = getImage(CElementImageProvider.getMacroImageDescriptor());
|
Image image = getImage(CElementImageProvider.getMacroImageDescriptor());
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
|
|
||||||
protected void handleBinding(IBinding binding,
|
protected void handleBinding(IBinding binding,
|
||||||
CContentAssistInvocationContext cContext,
|
CContentAssistInvocationContext cContext,
|
||||||
IASTCompletionContext astContext, List proposals) {
|
IASTCompletionContext astContext, List<CCompletionProposal> proposals) {
|
||||||
if ((binding instanceof CPPImplicitFunction
|
if ((binding instanceof CPPImplicitFunction
|
||||||
|| binding instanceof CPPImplicitFunctionTemplate || binding instanceof CPPImplicitTypedef)
|
|| binding instanceof CPPImplicitFunctionTemplate || binding instanceof CPPImplicitTypedef)
|
||||||
&& !(binding instanceof CPPImplicitMethod)) {
|
&& !(binding instanceof CPPImplicitMethod)) {
|
||||||
|
@ -237,7 +237,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
return name.length == 0 || name[0] == '{';
|
return name.length == 0 || name[0] == '{';
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleClass(ICPPClassType classType, IASTCompletionContext astContext, CContentAssistInvocationContext context, List proposals) {
|
private void handleClass(ICPPClassType classType, IASTCompletionContext astContext, CContentAssistInvocationContext context, List<CCompletionProposal> proposals) {
|
||||||
if (context.isContextInformationStyle()) {
|
if (context.isContextInformationStyle()) {
|
||||||
try {
|
try {
|
||||||
ICPPConstructor[] constructors = classType.getConstructors();
|
ICPPConstructor[] constructors = classType.getConstructors();
|
||||||
|
@ -257,7 +257,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFunction(IFunction function, CContentAssistInvocationContext context, List proposals) {
|
private void handleFunction(IFunction function, CContentAssistInvocationContext context, List<CCompletionProposal> proposals) {
|
||||||
Image image = getImage(function);
|
Image image = getImage(function);
|
||||||
|
|
||||||
StringBuffer repStringBuff = new StringBuffer();
|
StringBuffer repStringBuff = new StringBuffer();
|
||||||
|
@ -341,7 +341,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
proposals.add(proposal);
|
proposals.add(proposal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleVariable(IVariable variable, CContentAssistInvocationContext context, List proposals) {
|
private void handleVariable(IVariable variable, CContentAssistInvocationContext context, List<CCompletionProposal> proposals) {
|
||||||
StringBuffer repStringBuff = new StringBuffer();
|
StringBuffer repStringBuff = new StringBuffer();
|
||||||
repStringBuff.append(variable.getName());
|
repStringBuff.append(variable.getName());
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
|
|
||||||
private void handleNamespace(ICPPNamespace namespace,
|
private void handleNamespace(ICPPNamespace namespace,
|
||||||
IASTCompletionContext astContext,
|
IASTCompletionContext astContext,
|
||||||
CContentAssistInvocationContext cContext, List proposals) {
|
CContentAssistInvocationContext cContext, List<CCompletionProposal> proposals) {
|
||||||
if (astContext instanceof ICPPASTQualifiedName) {
|
if (astContext instanceof ICPPASTQualifiedName) {
|
||||||
IASTCompletionContext parent = ((ICPPASTQualifiedName) astContext)
|
IASTCompletionContext parent = ((ICPPASTQualifiedName) astContext)
|
||||||
.getCompletionContext();
|
.getCompletionContext();
|
||||||
|
@ -464,7 +464,7 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
} else if (binding instanceof ICPPFunctionTemplate) {
|
} else if (binding instanceof ICPPFunctionTemplate) {
|
||||||
imageDescriptor = CElementImageProvider.getFunctionImageDescriptor();
|
imageDescriptor = CElementImageProvider.getFunctionImageDescriptor();
|
||||||
} else if (binding instanceof ICPPUsingDeclaration) {
|
} else if (binding instanceof ICPPUsingDeclaration) {
|
||||||
ICPPDelegate[] delegates = ((ICPPUsingDeclaration)binding).getDelegates();
|
IBinding[] delegates = ((ICPPUsingDeclaration)binding).getDelegates();
|
||||||
if (delegates.length > 0)
|
if (delegates.length > 0)
|
||||||
return getImage(delegates[0]);
|
return getImage(delegates[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue