mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-06 07:45:50 +02:00
Start of Scope2 and cleaned up ASTNode a little.
This commit is contained in:
parent
4108c84536
commit
d11105a29b
2 changed files with 16 additions and 10 deletions
|
@ -16,4 +16,6 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IScope2 {
|
public interface IScope2 {
|
||||||
|
|
||||||
|
public IBinding getBinding(IASTName name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,21 +35,25 @@ public class CASTName extends CASTNode implements IASTName {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CASTName() {
|
public CASTName() {
|
||||||
name = EMPTY_CHAR_ARRAY;
|
name = EMPTY_CHAR_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
private static boolean inited = false;
|
||||||
* (non-Javadoc)
|
private static boolean useScope2 = false;
|
||||||
*
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IASTName#resolveBinding()
|
|
||||||
*/
|
|
||||||
public IBinding resolveBinding() {
|
public IBinding resolveBinding() {
|
||||||
if (binding == null)
|
if (binding == null) {
|
||||||
|
if (!inited) {
|
||||||
|
useScope2 = System.getProperty("doug.useScope2") != null ? true : false;
|
||||||
|
inited = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useScope2)
|
||||||
|
binding = getScope(this, getPropertyInParent()).getBinding(this);
|
||||||
|
else
|
||||||
CVisitor.createBinding(this);
|
CVisitor.createBinding(this);
|
||||||
|
}
|
||||||
|
|
||||||
return binding;
|
return binding;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue