Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-10-22 17:36:28 -0400
committerMike Kucera2009-10-22 17:36:28 -0400
commit1fbe0630f7f0c2f03a4f0b495d4cf17f6ad66620 (patch)
tree64459ad6f9b9a2fdedfe535b481a6621ce692c7b
parent609aeda50f3b6d6653b7db272f3db282d5587269 (diff)
downloadorg.eclipse.cdt-1fbe0630f7f0c2f03a4f0b495d4cf17f6ad66620.tar.gz
org.eclipse.cdt-1fbe0630f7f0c2f03a4f0b495d4cf17f6ad66620.tar.xz
org.eclipse.cdt-1fbe0630f7f0c2f03a4f0b495d4cf17f6ad66620.zip
Bug 292949 - XL C++ parser using wrong scanner config - updating keywords
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java
index 38d5b54e77..a838e9a64e 100644
--- a/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcKeywords.java
@@ -15,6 +15,7 @@ import java.util.Arrays;
import java.util.List;
import org.eclipse.cdt.core.dom.lrparser.CLanguageKeywords;
+import org.eclipse.cdt.core.dom.parser.IScannerExtensionConfiguration;
import org.eclipse.cdt.core.model.ICLanguageKeywords;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.util.CharArrayMap;
@@ -78,10 +79,16 @@ public class XlcKeywords extends CLanguageKeywords {
private XlcKeywords(ParserLanguage language) {
- super(language, XlcCScannerExtensionConfiguration.getInstance());
+ super(language, getConfig(language));
this.language = language;
}
+ private static IScannerExtensionConfiguration getConfig(ParserLanguage lang) {
+ return lang.isCPP()
+ ? XlcCPPScannerExtensionConfiguration.getInstance()
+ : XlcCScannerExtensionConfiguration.getInstance();
+ }
+
/**
* Returns the LPG token kind for additional keywords defined by
* the XLC extensions, null otherwise.
@@ -93,7 +100,8 @@ public class XlcKeywords extends CLanguageKeywords {
@Override
public synchronized String[] getKeywords() {
if(allKeywords == null) {
- ICLanguageKeywords base = new CLanguageKeywords(language, XlcCScannerExtensionConfiguration.getInstance());
+ IScannerExtensionConfiguration config = getConfig(language);
+ ICLanguageKeywords base = new CLanguageKeywords(language, config);
String[] baseKeywords = base.getKeywords();
List<String> keywords = new ArrayList<String>();

Back to the top