Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2003-03-03 14:01:20 -0500
committerDoug Schaefer2003-03-03 14:01:20 -0500
commit890defd85d8232383c8610497a236f17cdfc5c22 (patch)
treeebee767403eba73beed2a5cc1bfb60a0675c8314
parent9b8ab7bb2eaf865a7cb98b62ba3747e706252df4 (diff)
downloadorg.eclipse.cdt-890defd85d8232383c8610497a236f17cdfc5c22.tar.gz
org.eclipse.cdt-890defd85d8232383c8610497a236f17cdfc5c22.tar.xz
org.eclipse.cdt-890defd85d8232383c8610497a236f17cdfc5c22.zip
Uses the preference to determine whether to use the new or old parser.
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java
index 7bde8e2520..077de63d95 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java
@@ -8,6 +8,7 @@ package org.eclipse.cdt.internal.core.model;
import java.io.IOException;
import java.io.InputStream;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ISourceRange;
import org.eclipse.cdt.internal.core.newparser.Parser;
@@ -54,22 +55,19 @@ class TranslationUnitInfo extends CFileInfo {
protected void parse(InputStream in) {
try {
removeChildren();
- if (false) {
- // cdt 1.0 parser
- ModelBuilder modelBuilder= new ModelBuilder((TranslationUnit)getElement());
- CStructurizer.getCStructurizer().parse(modelBuilder, in);
- } else {
+ if (CCorePlugin.getDefault().useNewParser()) {
// new parser
NewModelBuilder modelBuilder = new NewModelBuilder((TranslationUnit)getElement());
Parser parser = new Parser(in, modelBuilder, true);
parser.parse();
+ } else {
+ // cdt 1.0 parser
+ ModelBuilder modelBuilder= new ModelBuilder((TranslationUnit)getElement());
+ CStructurizer.getCStructurizer().parse(modelBuilder, in);
}
} catch (Exception e) {
System.out.println(e);
}
-// } catch (IOException e) {
- //e.printStackTrace();
-// }
}
/* Overide the SourceManipulation for the range. */

Back to the top