From 4c4d89b4494bd81f04db21567767988d391aa954 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 14 Apr 2003 17:31:25 +0000 Subject: [PATCH] If the setting is enable use the new Parser diffs. --- .../cdt/internal/ui/compare/CStructureCreator.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java index a0822d701e0..27bb5c0d49f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java @@ -26,6 +26,7 @@ import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.Position; +import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.internal.parser.CStructurizer; import org.eclipse.cdt.internal.parser.IStructurizerCallback; @@ -69,14 +70,20 @@ public class CStructureCreator implements IStructureCreator { DocumentInputStream is= new DocumentInputStream(doc); IStructurizerCallback callback= new CNodeTreeConstructor(root, doc); try { - CStructurizer.getCStructurizer().parse(callback, is); + if (CCorePlugin.getDefault().useNewParser()) { + // new parser + ComparatorModelBuilder modelBuilder = new ComparatorModelBuilder(callback, (s != null ? s : "")); + modelBuilder.parse(); + } else { + CStructurizer.getCStructurizer().parse(callback, is); + } } catch (NodeConstructorError e) { System.out.println("Parse error: " + e); return null; } catch (IOException e) { return null; - } - + } + return root; }