Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2008-12-30 10:16:06 -0500
committerMike Kucera2008-12-30 10:16:06 -0500
commit60d92373d09eba3d2b19baf4fa52d8a60fc8ab4d (patch)
treeaf630d0370a66f83306b6080ecec9b8fdc12d613
parent35ae8a7431aabc1cec6e04fbce12065392955e5b (diff)
downloadorg.eclipse.cdt-60d92373d09eba3d2b19baf4fa52d8a60fc8ab4d.tar.gz
org.eclipse.cdt-60d92373d09eba3d2b19baf4fa52d8a60fc8ab4d.tar.xz
org.eclipse.cdt-60d92373d09eba3d2b19baf4fa52d8a60fc8ab4d.zip
fix for bug 240567 for the LR parsers
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java4
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java41
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/c99/C99Language.java2
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/ISOCPPLanguage.java2
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java2
5 files changed, 17 insertions, 34 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
index 97e97a41c4..db0aca142a 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/BaseExtensibleLanguage.java
@@ -108,8 +108,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
System.out.println();
}
- // TODO temporary
- IScannerExtensionConfiguration config = new ScannerExtensionConfiguration();
+ IScannerExtensionConfiguration config = getScannerExtensionConfiguration();
ParserLanguage pl = getParserLanguage();
IScanner preprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
@@ -161,7 +160,6 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
printCompletionNode(cn);
}
- // TODO temporary
IScannerExtensionConfiguration config = getScannerExtensionConfiguration();
ParserLanguage pl = getParserLanguage();
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java
index e63178b432..502ec24b53 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java
@@ -9,8 +9,6 @@
package org.eclipse.cdt.core.dom.lrparser;
import org.eclipse.cdt.core.dom.parser.AbstractScannerExtensionConfiguration;
-import org.eclipse.cdt.core.parser.IMacro;
-import org.eclipse.cdt.core.parser.util.CharArrayIntMap;
/**
@@ -19,26 +17,23 @@ import org.eclipse.cdt.core.parser.util.CharArrayIntMap;
* @author Mike Kucera
*
*/
+@SuppressWarnings("nls")
public class ScannerExtensionConfiguration extends AbstractScannerExtensionConfiguration {
- @Override
- public CharArrayIntMap getAdditionalKeywords() {
- return null;
+
+ private ScannerExtensionConfiguration() {
}
-
- @Override
- public IMacro[] getAdditionalMacros() {
- return null;
+
+ public static ScannerExtensionConfiguration createC() {
+ ScannerExtensionConfiguration sec = new ScannerExtensionConfiguration();
+ sec.addMacro("__null", "(void *)0");
+ return sec;
}
-
- @Override
- public CharArrayIntMap getAdditionalPreprocessorKeywords() {
- return null;
- }
-
- @Override
- public boolean initializeMacroValuesTo1() {
- return false;
+
+ public static ScannerExtensionConfiguration createCPP() {
+ ScannerExtensionConfiguration sec = new ScannerExtensionConfiguration();
+ sec.addMacro("__null", "0");
+ return sec;
}
@Override
@@ -46,14 +41,4 @@ public class ScannerExtensionConfiguration extends AbstractScannerExtensionConfi
return true;
}
- @Override
- public char[] supportAdditionalNumericLiteralSuffixes() {
- return null;
- }
-
- @Override
- public boolean supportMinAndMaxOperators() {
- return false;
- }
-
}
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/c99/C99Language.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/c99/C99Language.java
index 50a825be71..a32549434a 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/c99/C99Language.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/c99/C99Language.java
@@ -42,7 +42,7 @@ public class C99Language extends BaseExtensibleLanguage {
public static final String ID = PLUGIN_ID + ".c99"; //$NON-NLS-1$
private static final IDOMTokenMap TOKEN_MAP = DOMToC99TokenMap.DEFAULT_MAP;
- private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = new ScannerExtensionConfiguration();
+ private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = ScannerExtensionConfiguration.createC();
private static C99Language DEFAULT = new C99Language();
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/ISOCPPLanguage.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/ISOCPPLanguage.java
index b4bc11eff1..83920e3f17 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/ISOCPPLanguage.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/ISOCPPLanguage.java
@@ -43,7 +43,7 @@ public class ISOCPPLanguage extends BaseExtensibleLanguage {
private static final IDOMTokenMap TOKEN_MAP = DOMToISOCPPTokenMap.DEFAULT_MAP;
- private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = new ScannerExtensionConfiguration();
+ private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = ScannerExtensionConfiguration.createCPP();
private static ISOCPPLanguage DEFAULT = new ISOCPPLanguage();
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java
index c2b879a92d..88e9a4021c 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java
+++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java
@@ -47,7 +47,7 @@ public class UPCLanguage extends BaseExtensibleLanguage {
private static final UPCLanguage myDefault = new UPCLanguage();
- private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = new ScannerExtensionConfiguration();
+ private static final IScannerExtensionConfiguration SCANNER_CONFIGURATION = ScannerExtensionConfiguration.createC();
public static UPCLanguage getDefault() {

Back to the top