automatic version update by autodist [release 0.11b-1mamba;Mon May 31 2021]
This commit is contained in:
parent
d0b76e0114
commit
94b9bab604
@ -1,354 +0,0 @@
|
|||||||
diff -r -u -N java_cup_orig/AntTask.java java_cup/AntTask.java
|
|
||||||
--- java_cup_orig/AntTask.java 1970-01-01 10:00:00.000000000 +1000
|
|
||||||
+++ java_cup/AntTask.java 2003-06-04 03:11:53.000000000 +1000
|
|
||||||
@@ -0,0 +1,261 @@
|
|
||||||
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
+ * Ant task for CUP *
|
|
||||||
+ * Copyright (C) 2003 Gerwin Klein <lsf@jflex.de> *
|
|
||||||
+ * All rights reserved. *
|
|
||||||
+ * *
|
|
||||||
+ * License: LGPL 2, http://www.gnu.org/copyleft/lesser.html *
|
|
||||||
+ * *
|
|
||||||
+ * This library is free software; you can redistribute it and/or *
|
|
||||||
+ * modify it under the terms of the GNU Lesser General Public *
|
|
||||||
+ * License as published by the Free Software Foundation; either *
|
|
||||||
+ * version 2 of the License, or (at your option) any later version. *
|
|
||||||
+ * *
|
|
||||||
+ * This library is distributed in the hope that it will be useful, *
|
|
||||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
+ * Lesser General Public License for more details. *
|
|
||||||
+ * *
|
|
||||||
+ * You should have received a copy of the GNU Lesser General Public *
|
|
||||||
+ * License along with this library; if not, write to the Free Software *
|
|
||||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*
|
|
||||||
+ * *
|
|
||||||
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
||||||
+
|
|
||||||
+package java_cup;
|
|
||||||
+
|
|
||||||
+import org.apache.tools.ant.Task;
|
|
||||||
+import org.apache.tools.ant.BuildException;
|
|
||||||
+
|
|
||||||
+import java.io.*;
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ Example build.xml file for using CUP with Ant (assumes that java_cup classes
|
|
||||||
+ are available in classpath):
|
|
||||||
+
|
|
||||||
+ <project name="cup" default="jar">
|
|
||||||
+
|
|
||||||
+ <taskdef classname="java_cup.AntTask" name="cup" />
|
|
||||||
+
|
|
||||||
+ <target name="compile" depends="cup">
|
|
||||||
+ <javac srcdir="." destdir="bin" target="1.1" classpath="." />
|
|
||||||
+ </target>
|
|
||||||
+
|
|
||||||
+ <target name="cup">
|
|
||||||
+ <cup file="java_cup/parser.cup" dir="java_cup" nosummary="true" />
|
|
||||||
+ </target>
|
|
||||||
+
|
|
||||||
+ <target name="jar" depends="compile">
|
|
||||||
+ <jar basedir="bin" includes="java_cup/**" jarfile="java_cup.jar" />
|
|
||||||
+ </target>
|
|
||||||
+ </project>
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * An Ant task class for CUP, supports all CUP options available on
|
|
||||||
+ * the command line.
|
|
||||||
+ * <p>
|
|
||||||
+ * The option names are the same as on the command line. Options without
|
|
||||||
+ * parameters are booleans in Ant (-nosummary becomes nosummary="true")
|
|
||||||
+ * <p>
|
|
||||||
+ * Example build.xml file for Ant (assumes that java_cup classes
|
|
||||||
+ * are available in classpath):
|
|
||||||
+ * <pre>
|
|
||||||
+ * <project name="cup" default="jar">
|
|
||||||
+ *
|
|
||||||
+ * <taskdef classname="java_cup.AntTask" name="cup" />
|
|
||||||
+ *
|
|
||||||
+ * <target name="compile" depends="cup">
|
|
||||||
+ * <javac srcdir="." destdir="bin" target="1.1" classpath="." />
|
|
||||||
+ * </target>
|
|
||||||
+ *
|
|
||||||
+ * <target name="cup">
|
|
||||||
+ * <cup file="java_cup/parser.cup" dir="java_cup" nosummary="true" />
|
|
||||||
+ * </target>
|
|
||||||
+ *
|
|
||||||
+ * <target name="jar" depends="compile">
|
|
||||||
+ * <jar basedir="bin" includes="java_cup/**" jarfile="java_cup.jar" />
|
|
||||||
+ * </target>
|
|
||||||
+ * </project>
|
|
||||||
+ * </pre>
|
|
||||||
+ *
|
|
||||||
+ * @see java_cup.Main
|
|
||||||
+ *
|
|
||||||
+ * @author Gerwin Klein
|
|
||||||
+ */
|
|
||||||
+public class AntTask extends Task {
|
|
||||||
+
|
|
||||||
+ private File inputFile;
|
|
||||||
+
|
|
||||||
+ /* FIXME: this duplicates default settings,
|
|
||||||
+ * would be better to refactor settings from Main, emit, and here
|
|
||||||
+ * into an own class.
|
|
||||||
+ */
|
|
||||||
+ private String parserName = "parser";
|
|
||||||
+ private String symName = "sym";
|
|
||||||
+ private String packageName = null;
|
|
||||||
+
|
|
||||||
+ private File destinationDir;
|
|
||||||
+
|
|
||||||
+ private int expect = 0;
|
|
||||||
+
|
|
||||||
+ private boolean symInterface = false;
|
|
||||||
+ private boolean nonTerms = false;
|
|
||||||
+ private boolean compactRed = false;
|
|
||||||
+ private boolean noSummary = false;
|
|
||||||
+ private boolean noWarn = false;
|
|
||||||
+ private boolean dumpStates = false;
|
|
||||||
+ private boolean dumpTables = false;
|
|
||||||
+ private boolean printProgress = false;
|
|
||||||
+ private boolean dumpGrammar = false;
|
|
||||||
+ private boolean showTiming = false;
|
|
||||||
+ private boolean lrValues = true;
|
|
||||||
+ private boolean suppressScanner = false;
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Run the Ant task. Assumes that options have already been set
|
|
||||||
+ * with setter methods by Ant.
|
|
||||||
+ *
|
|
||||||
+ * @throws BuildException if build fails
|
|
||||||
+ */
|
|
||||||
+ public void execute() throws BuildException {
|
|
||||||
+ if (inputFile == null) {
|
|
||||||
+ throw new BuildException("No input file. Use <cup file=\"your_parser.cup\"/>");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!inputFile.canRead()) {
|
|
||||||
+ throw new BuildException("Cannot read input file " + inputFile);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ try {
|
|
||||||
+ File parserFile = new File(destinationDir, parserName + ".java");
|
|
||||||
+ File symFile = new File(destinationDir, symName + ".java");
|
|
||||||
+
|
|
||||||
+ if (inputFile.lastModified() > parserFile.lastModified()
|
|
||||||
+ || inputFile.lastModified() > symFile.lastModified()) {
|
|
||||||
+
|
|
||||||
+ // cup redefines System.in
|
|
||||||
+ InputStream systemIn_save = System.in;
|
|
||||||
+
|
|
||||||
+ /* run it. assumption: Main.parse_args works with empty
|
|
||||||
+ * argument list and does nothing */
|
|
||||||
+ configure();
|
|
||||||
+ Main.main(new String[0]);
|
|
||||||
+
|
|
||||||
+ // restore System.in
|
|
||||||
+ System.setIn(systemIn_save);
|
|
||||||
+
|
|
||||||
+ if (noSummary) {
|
|
||||||
+ System.out.println("Generated: " + parserFile + " and " + symFile);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } catch (IOException e) {
|
|
||||||
+ throw new BuildException("IOException: " + e.toString());
|
|
||||||
+ } catch (internal_error e) {
|
|
||||||
+ throw new BuildException("Internal CUP error.");
|
|
||||||
+ } catch (Exception e) {
|
|
||||||
+ throw new BuildException("CUP generation failed.");
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Configures cup accordings to the settings of this class
|
|
||||||
+ *
|
|
||||||
+ * @throws FileNotFoundException if inputFile does not exist
|
|
||||||
+ */
|
|
||||||
+ public void configure() throws FileNotFoundException {
|
|
||||||
+ System.setIn(new FileInputStream(inputFile));
|
|
||||||
+ Main.output_dir = destinationDir;
|
|
||||||
+ Main.sym_interface = symInterface;
|
|
||||||
+ emit.parser_class_name = parserName;
|
|
||||||
+ emit.symbol_const_class_name = symName;
|
|
||||||
+ emit.package_name = packageName;
|
|
||||||
+ Main.include_non_terms = nonTerms;
|
|
||||||
+ Main.expect_conflicts = expect;
|
|
||||||
+ Main.opt_compact_red = compactRed;
|
|
||||||
+ Main.no_summary = noSummary;
|
|
||||||
+ emit.nowarn = noWarn;
|
|
||||||
+ Main.opt_dump_states = dumpStates;
|
|
||||||
+ Main.opt_dump_grammar = dumpGrammar;
|
|
||||||
+ Main.opt_dump_tables = dumpTables;
|
|
||||||
+ Main.print_progress = printProgress;
|
|
||||||
+ Main.opt_show_timing = showTiming;
|
|
||||||
+ Main.lr_values = lrValues;
|
|
||||||
+ Main.suppress_scanner = suppressScanner;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setDir(File destinationDir) {
|
|
||||||
+ this.destinationDir = destinationDir;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setFile(File file) {
|
|
||||||
+ this.inputFile = file;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setParser(String name) {
|
|
||||||
+ this.parserName = name;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setSymbols(String name) {
|
|
||||||
+ this.symName = name;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setPackage(String name) {
|
|
||||||
+ this.packageName = name;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setInterface(boolean symInterface) {
|
|
||||||
+ this.symInterface = symInterface;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setCompact_red(boolean b) {
|
|
||||||
+ compactRed = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setDump_grammar(boolean b) {
|
|
||||||
+ dumpGrammar = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setDump_states(boolean b) {
|
|
||||||
+ dumpStates = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setDump_tables(boolean b) {
|
|
||||||
+ dumpTables = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setDump(boolean b) {
|
|
||||||
+ dumpStates = dumpTables = dumpGrammar = true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setExpect(int i) {
|
|
||||||
+ expect = i;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setNopositions(boolean b) {
|
|
||||||
+ lrValues = !b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setNonterms(boolean b) {
|
|
||||||
+ nonTerms = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setNosummary(boolean b) {
|
|
||||||
+ noSummary = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setNowarn(boolean b) {
|
|
||||||
+ noWarn = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setProgress(boolean b) {
|
|
||||||
+ printProgress = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setTime(boolean b) {
|
|
||||||
+ showTiming = b;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setNoscanner(boolean b) {
|
|
||||||
+ suppressScanner = b;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff -r -u -N java_cup_orig/Main.java java_cup/Main.java
|
|
||||||
--- java_cup_orig/Main.java 1999-07-24 23:16:59.000000000 +1000
|
|
||||||
+++ java_cup/Main.java 2003-06-04 03:03:41.000000000 +1000
|
|
||||||
@@ -25,6 +25,8 @@
|
|
||||||
* <dd> specify parser class name [default "parser"]
|
|
||||||
* <dt> -symbols name
|
|
||||||
* <dd> specify name for symbol constant class [default "sym"]
|
|
||||||
+ * <dt> -dir name
|
|
||||||
+ * <dd> put generated files into directory name [default "."]
|
|
||||||
* <dt> -interface
|
|
||||||
* <dd> emit symbol constant <i>interface</i>, rather than class
|
|
||||||
* <dt> -nonterms
|
|
||||||
@@ -110,6 +112,10 @@
|
|
||||||
* java_cup.runtime.Scanner for compatibility with old runtimes? */
|
|
||||||
protected static boolean suppress_scanner = false;
|
|
||||||
|
|
||||||
+ /** User option -- directory for ouput files */
|
|
||||||
+ protected static File output_dir = null;
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
/* Timing data (not all of these time intervals are mutually exclusive) */
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
@@ -244,6 +250,7 @@
|
|
||||||
" -parser name specify parser class name [default \"parser\"]\n" +
|
|
||||||
" -symbols name specify name for symbol constant class [default \"sym\"]\n"+
|
|
||||||
" -interface put symbols in an interface, rather than a class\n" +
|
|
||||||
+" -dir name put generated into directory name [default \".\"]" +
|
|
||||||
" -nonterms put non terminals in symbol constant class\n" +
|
|
||||||
" -expect # number of conflicts expected/allowed [default 0]\n" +
|
|
||||||
" -compact_red compact tables by defaulting to most frequent reduce\n" +
|
|
||||||
@@ -287,6 +294,15 @@
|
|
||||||
/* record the name */
|
|
||||||
emit.package_name = argv[i];
|
|
||||||
}
|
|
||||||
+ else if (argv[i].equals("-dir"))
|
|
||||||
+ {
|
|
||||||
+ if (++i >= len || argv[i].startsWith("-") ||
|
|
||||||
+ argv[i].endsWith(".cup"))
|
|
||||||
+ usage("-dir must have a name argument");
|
|
||||||
+
|
|
||||||
+ /* record the name */
|
|
||||||
+ output_dir = new File(argv[i]);
|
|
||||||
+ }
|
|
||||||
else if (argv[i].equals("-parser"))
|
|
||||||
{
|
|
||||||
/* must have an arg */
|
|
||||||
@@ -390,23 +406,23 @@
|
|
||||||
|
|
||||||
/* parser class */
|
|
||||||
out_name = emit.parser_class_name + ".java";
|
|
||||||
- fil = new File(out_name);
|
|
||||||
+ fil = new File(output_dir,out_name);
|
|
||||||
try {
|
|
||||||
parser_class_file = new PrintWriter(
|
|
||||||
new BufferedOutputStream(new FileOutputStream(fil), 4096));
|
|
||||||
} catch(Exception e) {
|
|
||||||
- System.err.println("Can't open \"" + out_name + "\" for output");
|
|
||||||
+ System.err.println("Can't open \"" + fil + "\" for output");
|
|
||||||
System.exit(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* symbol constants class */
|
|
||||||
out_name = emit.symbol_const_class_name + ".java";
|
|
||||||
- fil = new File(out_name);
|
|
||||||
+ fil = new File(output_dir,out_name);
|
|
||||||
try {
|
|
||||||
symbol_class_file = new PrintWriter(
|
|
||||||
new BufferedOutputStream(new FileOutputStream(fil), 4096));
|
|
||||||
} catch(Exception e) {
|
|
||||||
- System.err.println("Can't open \"" + out_name + "\" for output");
|
|
||||||
+ System.err.println("Can't open \"" + fil + "\" for output");
|
|
||||||
System.exit(4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -656,8 +672,11 @@
|
|
||||||
|
|
||||||
/* code location */
|
|
||||||
if (output_produced)
|
|
||||||
- System.err.println(" Code written to \"" + emit.parser_class_name +
|
|
||||||
- ".java\", and \"" + emit.symbol_const_class_name + ".java\".");
|
|
||||||
+ System.err.println(" Code written to \"" +
|
|
||||||
+ new File(output_dir, emit.parser_class_name) +
|
|
||||||
+ ".java\", and \"" +
|
|
||||||
+ new File(output_dir, emit.symbol_const_class_name) +
|
|
||||||
+ ".java\".");
|
|
||||||
else
|
|
||||||
System.err.println(" No code produced.");
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# java-cup script
|
|
||||||
# JPackage Project <http://www.jpackage.org/>
|
|
||||||
|
|
||||||
# Source functions library
|
|
||||||
if [ -f /usr/share/java-utils/java-functions ] ; then
|
|
||||||
. /usr/share/java-utils/java-functions
|
|
||||||
else
|
|
||||||
echo "Can't find functions library, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
MAIN_CLASS="java_cup.Main"
|
|
||||||
BASE_FLAGS=""
|
|
||||||
BASE_OPTIONS=""
|
|
||||||
BASE_JARS="java-cup java-cup-runtime"
|
|
||||||
|
|
||||||
# Set parameters
|
|
||||||
set_jvm
|
|
||||||
set_classpath $BASE_JARS
|
|
||||||
set_flags $BASE_FLAGS
|
|
||||||
set_options $BASE_OPTIONS
|
|
||||||
|
|
||||||
# Let's start
|
|
||||||
run "$@"
|
|
@ -1,13 +0,0 @@
|
|||||||
--- java_cup-0.11a/build.xml 2009-03-23 01:15:56.000000000 +0100
|
|
||||||
+++ java_cup-0.11a/build.xml-gil 2009-03-23 01:22:24.000000000 +0100
|
|
||||||
@@ -40,8 +40,8 @@
|
|
||||||
<delete dir="${dist}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
- <taskdef name="cup" classname="java_cup.anttask.CUPTask" classpath="${bin}/java-cup-11.jar" />
|
|
||||||
- <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="${bin}/JFlex.jar" />
|
|
||||||
+ <taskdef name="cup" classname="java_cup.anttask.CUPTask" classpath="/usr/share/java/java_cup.jar" />
|
|
||||||
+ <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="/usr/share/java/jflex.jar" />
|
|
||||||
|
|
||||||
<target name="cup" depends="init">
|
|
||||||
<cup srcfile="${cup}/parser.cup" interface="on" destdir="${java}" parser="parser" symbols="sym" quiet="false" nonterms="true"/>
|
|
@ -1,19 +0,0 @@
|
|||||||
--- java_cup-0.11a/build.xml 2006-03-28 13:34:52.000000000 +0200
|
|
||||||
+++ java_cup-0.11a/build.xml-gil 2009-03-23 00:50:54.000000000 +0100
|
|
||||||
@@ -73,7 +73,14 @@
|
|
||||||
<java jar="${dist}/java-cup-11a.jar" fork="true">
|
|
||||||
<arg value="-interface" />
|
|
||||||
<arg value="${cup}/parser.cup" />
|
|
||||||
- </java>
|
|
||||||
-
|
|
||||||
+ </java>
|
|
||||||
+ </target>
|
|
||||||
+
|
|
||||||
+ <target name="javadoc" >
|
|
||||||
+ <mkdir dir="${dist}/javadoc"/>
|
|
||||||
+ <javadoc destdir="${dist}/javadoc" author="true" version="true" use="true" windowtitle="java_cup API">
|
|
||||||
+ <fileset dir="${src}" defaultexcludes="yes">
|
|
||||||
+ </fileset>
|
|
||||||
+ </javadoc>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
@ -1,19 +0,0 @@
|
|||||||
--- java_cup-0.11a/src/java_cup/runtime/lr_parser.java 2006-03-28 13:34:52.000000000 +0200
|
|
||||||
+++ java_cup-0.11a/src/java_cup/runtime/lr_parser.java-gil 2009-03-23 01:32:51.000000000 +0100
|
|
||||||
@@ -121,6 +121,7 @@
|
|
||||||
* Simple constructor.
|
|
||||||
*/
|
|
||||||
public lr_parser() {
|
|
||||||
+ symbolFactory = new DefaultSymbolFactory();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -133,7 +134,7 @@
|
|
||||||
* Constructor that sets the default scanner and a SymbolFactory
|
|
||||||
*/
|
|
||||||
public lr_parser(Scanner s, SymbolFactory symfac) {
|
|
||||||
- this(); // in case default constructor someday does something
|
|
||||||
+ //this(); // in case default constructor someday does something
|
|
||||||
symbolFactory = symfac;
|
|
||||||
setScanner(s);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
--- java_cup-0.11a/build.xml 2009-03-23 00:52:49.000000000 +0100
|
|
||||||
+++ java_cup-0.11a/build.xml-gil 2009-03-23 00:54:58.000000000 +0100
|
|
||||||
@@ -62,7 +62,6 @@
|
|
||||||
<jar jarfile="${dist}/java-cup-11a.jar" basedir="${classes}">
|
|
||||||
<manifest>
|
|
||||||
<attribute name="Main-Class" value="java_cup/Main" />
|
|
||||||
- <attribute name="Class-Path" value="java-cup-11a-runtime.jar" />
|
|
||||||
</manifest>
|
|
||||||
</jar>
|
|
||||||
<jar jarfile="${dist}/java-cup-11a-runtime.jar" basedir="${classes}" includes="java_cup/runtime/*">
|
|
@ -1,22 +0,0 @@
|
|||||||
--- java_cup-0.11a/build.xml 2009-03-23 00:57:15.000000000 +0100
|
|
||||||
+++ java_cup-0.11a/build.xml-gil 2009-03-23 01:01:37.000000000 +0100
|
|
||||||
@@ -40,18 +40,7 @@
|
|
||||||
<delete dir="${dist}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
- <taskdef name="cup" classname="java_cup.anttask.CUPTask" classpath="${bin}/java-cup-11.jar" />
|
|
||||||
- <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="${bin}/JFlex.jar" />
|
|
||||||
-
|
|
||||||
- <target name="cup" depends="init">
|
|
||||||
- <cup srcfile="${cup}/parser.cup" interface="on" destdir="${java}" parser="parser" symbols="sym" quiet="false" nonterms="true"/>
|
|
||||||
- </target>
|
|
||||||
-
|
|
||||||
- <target name="jflex" depends="cup">
|
|
||||||
- <jflex file="${flex}/Lexer.jflex" destdir="${java}" />
|
|
||||||
- </target>
|
|
||||||
-
|
|
||||||
- <target name="compile" depends="jflex">
|
|
||||||
+ <target name="compile">
|
|
||||||
<copy todir="${java}"><fileset dir="${src}"></fileset></copy>
|
|
||||||
<javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.2" target="1.2">
|
|
||||||
<classpath refid="libraries"/>
|
|
@ -1,8 +0,0 @@
|
|||||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>java_cup</groupId>
|
|
||||||
<artifactId>java_cup</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
<name>Java CUP</name>
|
|
||||||
<version>0.11a</version>
|
|
||||||
</project>
|
|
@ -1,56 +0,0 @@
|
|||||||
<project name="java_cup" default="dist" basedir=".">
|
|
||||||
<description>
|
|
||||||
Jpackage build file for java_cup
|
|
||||||
</description>
|
|
||||||
<property name="src" location="src"/>
|
|
||||||
<property name="build" location="build"/>
|
|
||||||
<property name="dist" location="dist"/>
|
|
||||||
|
|
||||||
<target name="init">
|
|
||||||
<tstamp/>
|
|
||||||
<mkdir dir="${src}"/>
|
|
||||||
<mkdir dir="${build}"/>
|
|
||||||
<copy todir="${src}">
|
|
||||||
<fileset dir="java_cup"/>
|
|
||||||
</copy>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="compile" depends="init" description="Compilation">
|
|
||||||
<javac srcdir="${src}" destdir="${build}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="dist" depends="compile">
|
|
||||||
<mkdir dir="${dist}/lib"/>
|
|
||||||
<jar jarfile="${dist}/lib/java_cup.jar"
|
|
||||||
basedir="${build}"
|
|
||||||
excludes="java_cup/simple_calc/**,java_cup/runtime/**"
|
|
||||||
/>
|
|
||||||
<jar jarfile="${dist}/lib/java_cup-runtime.jar"
|
|
||||||
basedir="${build}"
|
|
||||||
includes="java_cup/runtime/**"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="javadoc" >
|
|
||||||
<mkdir dir="${dist}/javadoc"/>
|
|
||||||
<javadoc
|
|
||||||
destdir="${dist}/javadoc"
|
|
||||||
author="true"
|
|
||||||
version="true"
|
|
||||||
use="true"
|
|
||||||
windowtitle="java_cup API">
|
|
||||||
|
|
||||||
<fileset dir="src" defaultexcludes="yes">
|
|
||||||
</fileset>
|
|
||||||
</javadoc>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="clean" description="clean up" >
|
|
||||||
<!-- Delete the ${build} and ${dist} directory trees -->
|
|
||||||
<delete dir="${build}"/>
|
|
||||||
<delete dir="${dist}"/>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
|
|
173
java_cup.spec
173
java_cup.spec
@ -1,133 +1,36 @@
|
|||||||
%define pkgver 10k
|
%define minver %(echo %version | cut -d. -f2)
|
||||||
%define bootstrap 0
|
|
||||||
%define with_gcj_support 0
|
|
||||||
Name: java_cup
|
Name: java_cup
|
||||||
Version: 0.11a
|
Version: 0.11b
|
||||||
Release: 4mamba
|
Release: 1mamba
|
||||||
Summary: CUP Parser Generator for Java
|
Summary: CUP Parser Generator for Java
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
Vendor: openmamba
|
Vendor: openmamba
|
||||||
Distribution: openmamba
|
Distribution: openmamba
|
||||||
Packager: gil <puntogil@libero.it>
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
URL: http://www2.cs.tum.edu/projects/cup/
|
URL: http://www2.cs.tum.edu/projects/cup/
|
||||||
#Source0: http://www.cs.princeton.edu/%7Eappel/modern/java/CUP/java_cup_v%{pkgver}.tar.gz
|
Source0: http://www2.cs.tum.edu/projects/cup/releases/java-cup-bin-%{minver}-20160615.tar.gz
|
||||||
# svn export https://www2.in.tum.de/repos/cup/develop/ java_cup-0.11a
|
|
||||||
# tar czf java_cup-0.11a.tar.gz java_cup-0.11a
|
|
||||||
Source0: java_cup-0.11a.tar.gz
|
|
||||||
Source1: java_cup-build.xml
|
|
||||||
Source2: java-cup-generated-files.tar.bz2
|
|
||||||
Source3: java-cup.script
|
|
||||||
Source4: java_cup-0.11a-pom.xml
|
|
||||||
#http://jflex.de/
|
|
||||||
Patch0: cup-ant-task.patch
|
|
||||||
Patch1: java_cup-0.11a-javadoc.patch
|
|
||||||
Patch2: java_cup-0.11a-no-classpath-in-manifest.patch
|
|
||||||
Patch3: java_cup-0.11a-no-cup-no-jflex.patch
|
|
||||||
Patch4: java_cup-0.11a-classpath.patch
|
|
||||||
# missing symbolFactory initialization in lr_parser, causes sinjdoc to crash
|
|
||||||
Patch5: java_cup-0.11a-lr_parser-constructor.patch
|
|
||||||
License: BSD, LGPL
|
License: BSD, LGPL
|
||||||
Requires: coreutils
|
## AUTOBUILDREQ-BEGIN
|
||||||
BuildRequires: apache-ant
|
## AUTOBUILDREQ-END
|
||||||
%if "%{stage1}" != "1"
|
BuildRequires: javapackages
|
||||||
BuildRequires: java_cup
|
|
||||||
BuildRequires: java-jflex143
|
|
||||||
%endif
|
|
||||||
BuildRequires: java-gcj-compat
|
|
||||||
BuildRequires: jpackage-utils
|
|
||||||
BuildRequires: sinjdoc
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{name} is a LALR Parser Generator for Java.
|
%{name} is a LALR Parser Generator for Java.
|
||||||
|
|
||||||
%package javadoc
|
|
||||||
Group: Documentation
|
|
||||||
Summary: Javadoc for %{name}
|
|
||||||
|
|
||||||
%description javadoc
|
|
||||||
%{name} is a LALR Parser Generator for Java
|
|
||||||
|
|
||||||
This package contains Javadoc for %{name}.
|
|
||||||
|
|
||||||
%package manual
|
|
||||||
Group: Documentation
|
|
||||||
Summary: Documentation for %{name}.
|
|
||||||
|
|
||||||
%description manual
|
|
||||||
%{name} is a LALR Parser Generator for Java
|
|
||||||
|
|
||||||
This package contains documentation for %{name}.
|
|
||||||
%if %with_gcj_support
|
|
||||||
%package gcj
|
|
||||||
Summary: GCJ %{name} support
|
|
||||||
Group: System/Libraries/Java
|
|
||||||
BuildRequires: java-gcj-compat
|
|
||||||
BuildRequires: libgcj4-devel
|
|
||||||
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
|
|
||||||
Requires: java-gcj-compat
|
|
||||||
Requires: jpackage-utils
|
|
||||||
|
|
||||||
%description gcj
|
|
||||||
%{name} - CUP Parser Generator for Java.
|
|
||||||
|
|
||||||
This package contains GCJ %{name} support.
|
|
||||||
%endif
|
|
||||||
%prep
|
%prep
|
||||||
|
%setup -q -c
|
||||||
%setup -q -n %{name}-%{version}
|
|
||||||
%patch1 -p1
|
|
||||||
%patch2 -p1
|
|
||||||
%if "%{stage1}" == "1"
|
|
||||||
%setup -q -T -D -a 2 -n %{name}-%{version}
|
|
||||||
echo "=========== BOOTSTRAP ============"
|
|
||||||
%patch3 -p1
|
|
||||||
%else
|
|
||||||
echo "========== NO BOOTSTRAP ==========="
|
|
||||||
for j in $(find -name "*.jar"); do
|
|
||||||
rm -rf $j
|
|
||||||
done
|
|
||||||
for c in $(find -name "*.class"); do
|
|
||||||
rm -rf $c
|
|
||||||
done
|
|
||||||
%patch4 -p1
|
|
||||||
%endif
|
|
||||||
%patch5 -p1
|
|
||||||
|
|
||||||
|
|
||||||
perl -pi -e 's/1\.2/1.5/g' build.xml
|
|
||||||
mkdir -p classes
|
|
||||||
mkdir -p dist
|
|
||||||
|
|
||||||
#%patch0 -p0
|
|
||||||
#install -m 644 %{S:1} build.xml
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export JAVA_HOME=%java_home
|
|
||||||
%if "%{stage1}" == "1"
|
|
||||||
export CLASSPATH=
|
|
||||||
%else
|
|
||||||
export CLASSPATH=$(build-classpath java-cup jflex/jflex)
|
|
||||||
%endif
|
|
||||||
export OPT_JAR_LIST=
|
|
||||||
|
|
||||||
ant
|
|
||||||
find . -name parser.cup -exec rm {} \;
|
|
||||||
ant javadoc
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_javadir}
|
mkdir -p %{buildroot}%{_javadir}
|
||||||
install -m 644 dist/java-cup-11a.jar \
|
install -m 644 java-cup-%{minver}.jar \
|
||||||
%{buildroot}%{_javadir}/java-cup-%{version}.jar
|
%{buildroot}%{_javadir}/java-cup-%{version}.jar
|
||||||
install -m 644 dist/java-cup-11a-runtime.jar \
|
install -m 644 java-cup-%{minver}-runtime.jar \
|
||||||
%{buildroot}%{_javadir}/java-cup-runtime-%{version}.jar
|
%{buildroot}%{_javadir}/java-cup-runtime-%{version}.jar
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/maven2/poms
|
|
||||||
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-java_cup.pom
|
|
||||||
%add_to_maven_depmap java_cup java_cup %{version} JPP java_cup
|
|
||||||
|
|
||||||
(
|
(
|
||||||
cd %{buildroot}%{_javadir}
|
cd %{buildroot}%{_javadir}
|
||||||
for jar in *-%{version}*; do
|
for jar in *-%{version}*; do
|
||||||
@ -137,70 +40,22 @@ install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-java_cup.pom
|
|||||||
ln -sf java-cup-runtime-%{version}.jar %{name}-runtime.jar
|
ln -sf java-cup-runtime-%{version}.jar %{name}-runtime.jar
|
||||||
)
|
)
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version}
|
|
||||||
cp -pr dist/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
|
|
||||||
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-%{version} %{name})
|
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_bindir}
|
|
||||||
install -pm 755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}
|
|
||||||
|
|
||||||
%if %with_gcj_support
|
|
||||||
%{_bindir}/aot-compile-rpm
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
|
|
||||||
%post
|
|
||||||
%update_maven_depmap
|
|
||||||
|
|
||||||
%postun
|
|
||||||
%update_maven_depmap
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_bindir}/java_cup
|
|
||||||
%{_javadir}/java-cup-%{version}.jar
|
%{_javadir}/java-cup-%{version}.jar
|
||||||
%{_javadir}/java-cup-runtime-%{version}.jar
|
%{_javadir}/java-cup-runtime-%{version}.jar
|
||||||
%{_javadir}/java-cup-runtime.jar
|
%{_javadir}/java-cup-runtime.jar
|
||||||
%{_javadir}/java-cup.jar
|
%{_javadir}/java-cup.jar
|
||||||
%{_javadir}/java_cup-runtime.jar
|
%{_javadir}/java_cup-runtime.jar
|
||||||
%{_javadir}/java_cup.jar
|
%{_javadir}/java_cup.jar
|
||||||
%{_datadir}/maven2/poms
|
|
||||||
%{_mavendepmapfragdir}
|
|
||||||
%doc changelog.txt
|
|
||||||
|
|
||||||
%if %with_gcj_support
|
|
||||||
%post gcj
|
|
||||||
/sbin/ldconfig
|
|
||||||
if [ -x %{_bindir}/rebuild-gcj-db ]; then
|
|
||||||
%{_bindir}/rebuild-gcj-db
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun gcj
|
|
||||||
/sbin/ldconfig
|
|
||||||
if [ -x %{_bindir}/rebuild-gcj-db ]; then
|
|
||||||
%{_bindir}/rebuild-gcj-db
|
|
||||||
fi
|
|
||||||
|
|
||||||
%files gcj
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%{_libdir}/gcj/java_cup/java-cup-%{version}.jar.db
|
|
||||||
%{_libdir}/gcj/java_cup/java-cup-%{version}.jar.so
|
|
||||||
%{_libdir}/gcj/java_cup/java_cup-runtime-%{version}.jar.db
|
|
||||||
%{_libdir}/gcj/java_cup/java_cup-runtime-%{version}.jar.so
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files javadoc
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%{_javadocdir}/java_cup-%{version}
|
|
||||||
%{_javadocdir}/java_cup
|
|
||||||
|
|
||||||
%files manual
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%doc manual.html
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 31 2021 Automatic Build System <autodist@mambasoft.it> 0.11b-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
* Fri Feb 25 2011 gil <puntogil@libero.it> 0.11a-4mamba
|
* Fri Feb 25 2011 gil <puntogil@libero.it> 0.11a-4mamba
|
||||||
- rebuilt with java-gcj-compat 1.0.80-20mamba support
|
- rebuilt with java-gcj-compat 1.0.80-20mamba support
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user