Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2010-03-16 14:35:48 -0400
committerMike Kucera2010-03-16 14:35:48 -0400
commitd3386e3dd276f7e9ecd9132beb2149fb3b731f02 (patch)
tree54e07ee1fc57ecb9a12a9f2fb2293cea23589dd5 /lrparser
parent6fd9d653583adf3f0c109f0e2ac4c13b67149386 (diff)
downloadorg.eclipse.cdt-d3386e3dd276f7e9ecd9132beb2149fb3b731f02.tar.gz
org.eclipse.cdt-d3386e3dd276f7e9ecd9132beb2149fb3b731f02.tar.xz
org.eclipse.cdt-d3386e3dd276f7e9ecd9132beb2149fb3b731f02.zip
Bug 303065 - support new constructs by the upcoming v11.1 XL C/C++ compiler
Diffstat (limited to 'lrparser')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/grammar/generate.xml41
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/grammar/parserBuild.properties14
2 files changed, 49 insertions, 6 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/grammar/generate.xml b/lrparser/org.eclipse.cdt.core.lrparser/grammar/generate.xml
index 6241db9594..7052b3f7de 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/grammar/generate.xml
+++ b/lrparser/org.eclipse.cdt.core.lrparser/grammar/generate.xml
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2009 IBM Corporation and others.
+ Copyright (c) 2009, 2010 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
@@ -21,7 +21,8 @@
Additionally if the $Import or $Include directives are being used in a grammar
file then the LPG_INCLUDE environment variable must be set to the directory
- of the files being included.
+ of the files being included.
+ lpg_include - is an optional property to set, if it is set, LPG_INCLUDE will be set by its value before execute lpg_exe.
-->
<fail unless="lpg_exe">
@@ -41,24 +42,52 @@
${grammar_name} - the name of the main grammar file to run LPG on (not including the .g extension)
${output_dir} - name of directory where generated files should go
-->
- <target name="generate">
+ <target name="generate" depends="moveFile">
+
+
+ <echo message="Code generation is done."/>
+
+
+ </target>
+
+ <target name="init">
+
<property name="grammar_file" value="${grammar_dir}/${grammar_name}.g"/>
<echo message="lpg_exe=${lpg_exe}"/>
<echo message="lpg_template=${lpg_template}"/>
+ <echo message="lpg_include=${lpg_include}"/>
<echo message="grammar_file=${grammar_file}.g"/>
<echo message="output_dir=${output_dir}"/>
-
+
+
+ </target>
+
+ <target name="generateWithIncludeSet" if="lpg_include" depends="init">
+
<exec executable="${lpg_exe}">
<arg value="${grammar_file}"/>
<env key="LPG_TEMPLATE" path="${lpg_template}"/>
+ <env key="LPG_INCLUDE" path="${lpg_include}"/>
</exec>
+ </target>
+
+ <target name="generateWithoutIncludeSet" unless="lpg_include" depends="generateWithIncludeSet">
+
+ <exec executable="${lpg_exe}">
+ <arg value="${grammar_file}"/>
+ <env key="LPG_TEMPLATE" path="${lpg_template}"/>
+
+ </exec>
+ </target>
+
+ <target name="moveFile" depends="generateWithoutIncludeSet">
<move overwrite="true" toDir="${output_dir}">
<fileset dir=".">
<include name="${grammar_name}*.*"/>
- </fileset>
+ </fileset>
</move>
- </target>
+ </target>
</project> \ No newline at end of file
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/grammar/parserBuild.properties b/lrparser/org.eclipse.cdt.core.lrparser/grammar/parserBuild.properties
new file mode 100644
index 0000000000..6c6b72825a
--- /dev/null
+++ b/lrparser/org.eclipse.cdt.core.lrparser/grammar/parserBuild.properties
@@ -0,0 +1,14 @@
+
+###############################################################################
+# Copyright (c) 2010 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+lpg_exe=D:/lpg/lpgdistribution/lpgexe/lpg.exe
+lpg_template=D:/newWorkspace/CDT_LOCAL/org.eclipse.cdt.core.lrparser/grammar/template \ No newline at end of file

Back to the top