mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Removed unused code.
This commit is contained in:
parent
5d6f846caf
commit
9408357b60
1 changed files with 7 additions and 25 deletions
|
@ -13,14 +13,7 @@ package org.eclipse.cdt.internal.pdom.tests;
|
|||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.IPDOMNode;
|
||||
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.IBasicType;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||
import org.eclipse.cdt.internal.core.index.CIndex;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexFragment;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||
|
@ -42,8 +35,8 @@ public class PDOMPrettyPrinter implements IPDOMVisitor {
|
|||
// if (node instanceof PDOMCPPClassTemplate) {
|
||||
// ((PDOMCPPClassTemplate) node).specializationsAccept(this);
|
||||
// }
|
||||
if(indent.length()>=step.length())
|
||||
indent.setLength(indent.length()-step.length());
|
||||
if (indent.length() >= step.length())
|
||||
indent.setLength(indent.length() - step.length());
|
||||
}
|
||||
|
||||
public boolean visit(IPDOMNode node) throws CoreException {
|
||||
|
@ -51,21 +44,10 @@ public class PDOMPrettyPrinter implements IPDOMVisitor {
|
|||
StringBuilder sb= new StringBuilder();
|
||||
sb.append(indent);
|
||||
sb.append(node);
|
||||
if(node instanceof PDOMBinding) {
|
||||
if (node instanceof PDOMBinding) {
|
||||
sb.append(" ");
|
||||
PDOMBinding binding= (PDOMBinding) node;
|
||||
sb.append(" "+binding.getRecord());
|
||||
}
|
||||
if(node instanceof ICPPVariable) {
|
||||
try {
|
||||
IType type= SemanticUtil.getUltimateTypeUptoPointers(((ICPPVariable)node).getType());
|
||||
if(type instanceof ICPPBasicType) {
|
||||
IASTExpression e1= ((IBasicType)type).getValue();
|
||||
sb.append(" value="+(e1==null?"null":e1.toString()));
|
||||
}
|
||||
} catch(DOMException de) {
|
||||
sb.append(" "+de.getMessage());
|
||||
}
|
||||
sb.append(" " + binding.getRecord());
|
||||
}
|
||||
System.out.println(sb);
|
||||
return true;
|
||||
|
@ -79,7 +61,7 @@ public class PDOMPrettyPrinter implements IPDOMVisitor {
|
|||
*/
|
||||
public static void dumpLinkage(IIndex index, final int linkageID) {
|
||||
final IPDOMVisitor v= new PDOMPrettyPrinter();
|
||||
IIndexFragment[] frg= ((CIndex)index).getPrimaryFragments();
|
||||
IIndexFragment[] frg= ((CIndex) index).getPrimaryFragments();
|
||||
for (IIndexFragment element : frg) {
|
||||
final PDOM pdom = (PDOM) element;
|
||||
dumpLinkage(pdom, linkageID, v);
|
||||
|
@ -111,8 +93,8 @@ public class PDOMPrettyPrinter implements IPDOMVisitor {
|
|||
}
|
||||
});
|
||||
}
|
||||
} catch(CoreException ce) {
|
||||
CCorePlugin.log(ce);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue