From b0f858c25bf331b4452b4219b05cf67bf6accdea Mon Sep 17 00:00:00 2001 From: John Camelon Date: Fri, 11 Feb 2005 17:56:03 +0000 Subject: [PATCH] Patch for Devin Steffler. Further AST View - Preprocessor statements. --- .../DOMAST/CPPPopulateASTViewAction.java | 47 ++++++++++-------- .../tests/DOMAST/CPopulateASTViewAction.java | 48 +++++++++++-------- 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java index 90ea81c50c0..4189e2d9cac 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java @@ -44,6 +44,7 @@ import org.eclipse.cdt.internal.core.parser.scanner2.LocationMap.ASTInclusionSta * @author dsteffle */ public class CPPPopulateASTViewAction extends CPPBaseVisitorAction implements IPopulateDOMASTAction { + private static final int INITIAL_INCLUDE_STATEMENT_SIZE = 8; { processNames = true; processDeclarations = true; @@ -215,24 +216,17 @@ public class CPPPopulateASTViewAction extends CPPBaseVisitorAction implements IP addRoot(((IASTPreprocessorMacroDefinition)node).getName()); } - private void mergeMacros(IASTPreprocessorMacroDefinition[] macros) { - for(int i=0; i includes.length) { + IASTPreprocessorIncludeStatement[] newIncludes = new IASTPreprocessorIncludeStatement[includes.length * 2]; + for (int j=0; j includes.length) { + IASTPreprocessorIncludeStatement[] newIncludes = new IASTPreprocessorIncludeStatement[includes.length * 2]; + for (int j=0; j=0; i--) { if (treeIncludes[i] == null) continue; - + for(int j=root.getChildren().length-1; j>=0; j--) { child = root.getChildren()[j]; @@ -262,5 +269,4 @@ public class CPopulateASTViewAction extends CBaseVisitorAction implements IPopul } } } - }