Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/upc
diff options
context:
space:
mode:
authorMike Kucera2009-04-15 19:24:57 +0000
committerMike Kucera2009-04-15 19:24:57 +0000
commitd99739839b5dc6daf3b56b5c6174fa7983b3d39f (patch)
tree96736687c4c02a9667b10c89a75f7fa34e2a4723 /upc
parente389841b9f2af094c2c3417bc0a982978c19417d (diff)
downloadorg.eclipse.cdt-d99739839b5dc6daf3b56b5c6174fa7983b3d39f.tar.gz
org.eclipse.cdt-d99739839b5dc6daf3b56b5c6174fa7983b3d39f.tar.xz
org.eclipse.cdt-d99739839b5dc6daf3b56b5c6174fa7983b3d39f.zip
[272375] support for UTF string literals in LR parser
Diffstat (limited to 'upc')
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/grammar/build.xml32
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java4
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/upc/UPCLanguage.java9
3 files changed, 6 insertions, 39 deletions
diff --git a/upc/org.eclipse.cdt.core.parser.upc/grammar/build.xml b/upc/org.eclipse.cdt.core.parser.upc/grammar/build.xml
index fb3fb979f0b..14946c96cc2 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/grammar/build.xml
+++ b/upc/org.eclipse.cdt.core.parser.upc/grammar/build.xml
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2006, 2008 IBM Corporation and others.
+ Copyright (c) 2006, 2009 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -12,15 +12,7 @@
<project name="UPC Parser" default="upc" basedir=".">
<description>Generates the UPC parser from LPG grammar files</description>
- <fail unless="lpg_exe">
- Property $${lpg_exe} not set.
- This property must be set to the full path to the LPG generator executable.
- </fail>
-
- <fail unless="lpg_template">
- Property $${lpg_template} not set.
- This property must be set to the full path to the LPG templates folder.
- </fail>
+ <import file="../../org.eclipse.cdt.core.lrparser/grammar/generate.xml"/>
<property name="upc_location" value="../src/org/eclipse/cdt/internal/core/dom/parser/upc"/>
@@ -52,25 +44,5 @@
<param name="grammar_name" value="${grammar_name}"/>
</antcall>
</target>
-
-
- <target name="generate">
- <property name="grammar_file" value="${grammar_dir}/${grammar_name}.g"/>
- <echo message="lpg_exe=${lpg_exe}"/>
- <echo message="lpg_template=${lpg_template}"/>
- <echo message="grammar_file=${grammar_file}.g"/>
- <echo message="output_dir=${output_dir}"/>
-
- <exec executable="${lpg_exe}">
- <arg value="${grammar_file}"/>
- <env key="LPG_TEMPLATE" path="${lpg_template}"/>
- </exec>
-
- <move overwrite="true" toDir="${output_dir}">
- <fileset dir=".">
- <include name="${grammar_name}*.*"/>
- </fileset>
- </move>
- </target>
</project> \ No newline at end of file
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java
index d626097072b..1a25a3d5f0d 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java
+++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/core/dom/parser/upc/DOMToUPCTokenMap.java
@@ -130,8 +130,12 @@ public class DOMToUPCTokenMap implements IDOMTokenMap {
case tFLOATINGPT : return TK_floating;
case tSTRING : return TK_stringlit;
case tLSTRING : return TK_stringlit;
+ case tUTF16STRING : return TK_stringlit;
+ case tUTF32STRING : return TK_stringlit;
case tCHAR : return TK_charconst;
case tLCHAR : return TK_charconst;
+ case tUTF16CHAR : return TK_charconst;
+ case tUTF32CHAR : return TK_charconst;
case t__Bool : return TK__Bool;
case t__Complex : return TK__Complex;
case t__Imaginary : return TK__Imaginary;
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 2286fb1b05a..e8fc84afb49 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
@@ -25,8 +25,6 @@ import org.eclipse.cdt.core.dom.parser.upc.DOMToUPCTokenMap;
import org.eclipse.cdt.core.dom.parser.upc.UPCLanguageKeywords;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ICLanguageKeywords;
-import org.eclipse.cdt.core.model.IContributedModelBuilder;
-import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.parser.IScanner;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.internal.core.dom.parser.upc.UPCParser;
@@ -51,13 +49,6 @@ public class UPCLanguage extends BaseExtensibleLanguage {
protected IParser<IASTTranslationUnit> getParser(IScanner scanner, IIndex index, Set<Options> options) {
return new UPCParser(scanner, new DOMToUPCTokenMap(), getBuiltinBindingsProvider(), index, options);
}
-
- /**
- * @param tu Not used, default model builder used.
- */
- public IContributedModelBuilder createModelBuilder(ITranslationUnit tu) {
- return null;
- }
public String getId() {
return ID;

Back to the top