Commit ed851e44 authored by Markus Koschany's avatar Markus Koschany

Import Debian changes 0.11b-20160615-1

cup (0.11b-20160615-1) unstable; urgency=medium

  * Team upload.
  * New upstream version 0.11b-20160615.
  * Switch to compat level 11.
  * Change the all versions to 0.11b.
  * Convert debian/copyright to copyright format 1.0.
  * Update build.patch for new release.
  * Declare compliance with Debian Policy 4.2.1.
  * Depend on java8-runtime-headless
parents 9831260a 7f3969ef
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/usr/share/ant/lib/ant.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>CUP</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<project name="emugen" default ="dist" basedir=".">
<project name="cup" default ="dist" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="etc" location="etc" />
<property name="bin" location="bin" />
<property name="lib" location="lib" />
......@@ -13,10 +13,34 @@
<!-- initialize the workspace -->
<target name="init">
<tstamp />
<available file="version.txt" property="version.present" />
<touch unless:set="version.present" file="version.txt" />
<mkdir dir="${src}" />
<mkdir dir="${java}" />
<mkdir dir="${classes}" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}" />
<loadfile property="cupversion" srcFile="version.txt" failonerror="false" />
<property name="cupversion" value="custombuild" unless:set="cupversion"/>
<exec executable="git" outputproperty="gitversion">
<arg value="log"/>
<arg value="-1"/>
<arg value="--format=%h"/>
</exec>
<exec executable="git" outputproperty="changed">
<arg value="status"/>
<arg value="--porcelain"/>
<redirector>
<outputfilterchain>
<linecontainsregexp>
<regexp pattern='^M.*'/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern=".*" replace="modifications based on "/>
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>
<property name="svnversion">${changed}${gitversion}</property>
</target>
<property environment="env" />
......@@ -53,27 +77,82 @@
<target name="compile" depends="jflex">
<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">
<replace file="${java}/java_cup/version.java"
token="+ version_str"
value='+ "v0.11b ${cupversion} (GIT ${svnversion})"'>
</replace>
<javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.8" target="1.8">
<classpath refid="libraries"/>
</javac>
</target>
<target name="dist" depends="compile">
<jar jarfile="${dist}/java-cup-11a.jar" basedir="${classes}">
<jar jarfile="${dist}/java-cup-11b.jar" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="java_cup/Main" />
<attribute name="Class-Path" value="java-cup-11a-runtime.jar" />
<attribute name="Class-Path" value="java-cup-11b-runtime.jar" />
</manifest>
</jar>
<jar jarfile="${dist}/java-cup-11a-runtime.jar" basedir="${classes}" includes="java_cup/runtime/*">
<jar jarfile="${dist}/java-cup-11b-runtime.jar" basedir="${classes}" includes="java_cup/runtime/*">
</jar>
<tar longfile="gnu" destfile="${dist}/java-cup-bin-11b-${cupversion}.tar.gz" compression="gzip">
<tarfileset dir="${dist}" username="ant" group="ant">
<depth max="0"/>
<include name="*.jar"/>
</tarfileset>
</tar>
</target>
<target name="src-dist" depends="dist">
<tar longfile="gnu" destfile="${dist}/java-cup-src-11b-${cupversion}.tar.gz" compression="gzip">
<tarfileset dir="${src}" username="ant" group="ant" prefix="src/">
<include name="**"/>
</tarfileset>
<tarfileset dir="${cup}" username="ant" group="ant" prefix="cup/">
<include name="**"/>
</tarfileset>
<tarfileset dir="${flex}" username="ant" group="ant" prefix="flex/">
<include name="**"/>
</tarfileset>
<tarfileset dir="${bin}" username="ant" group="ant" prefix="bin/">
<include name="**"/>
</tarfileset>
<tarfileset dir="${lib}" username="ant" group="ant" prefix="lib/">
<include name="**"/>
</tarfileset>
<tarfileset dir="${src}/.." username="ant" group="ant">
<depth max="0"/>
<include name="*"/>
</tarfileset>
</tar>
</target>
<target name="test" depends="dist">
<java jar="${dist}/java-cup-11a.jar" fork="true">
<java jar="${dist}/java-cup-11b.jar" fork="true">
<arg value="-interface" />
<arg value="${cup}/parser.cup" />
</java>
</target>
<target name="versionbump" depends="init">
<echo message="${DSTAMP}" file="version.txt" />
</target>
<target name="scp" depends="src-dist">
<exec executable="scp">
<arg value="${dist}/java-cup-src-11b-${cupversion}.tar.gz" />
<arg value="${dist}/java-cup-bin-11b-${cupversion}.tar.gz" />
<arg value="${dist}/../manual.html" />
<arg value="petter@www2.in.tum.de:/srv/www/htdocs/projects/cup/releases" />
</exec>
</target>
<target name="help" depends="init">
<echo message="Targets:" />
<echo message=" dist to create CUP jars" />
<echo message=" src-dist to create release packages" />
<echo message=" scp to deploy relase to homepage" />
<echo message=" versionbump to inc release" />
</target>
</project>
CUP version 0.11b 20151001 is a feature release.
Implemented a generic pre-/post DFS search with visitor support
Also added fragments of XPath 1.0 query support on parse trees
Fixed the visibility of children and the variant attribute of XMLElement
M. Petter
Technische Universität München
2015/10/01
------------------------------------------------------------------------
CUP version 0.11b 20150326 is a bugfix release.
Fixed an issue with empty productions having non-empty location information
Fixed an issue with deprecation of constructors
M. Petter
Technische Universität München
2015/02/26
------------------------------------------------------------------------
CUP version 0.11b 20150226 is a feature release.
added the means to move Locations
M. Petter
Technische Universität München
2015/02/26
------------------------------------------------------------------------
CUP version 0.11b 20140808 is a feature/bugfix release.
added expected symbols to the report_error(...) method
added an expected_token_ids() to inform about valid continuations
added parameters and code to enable automatic creation of XML parse trees
fixed a bug in the lookahead computation
M. Petter
Technische Universität München
2014/02/26
------------------------------------------------------------------------
CUP version 0.11b beta 20140226 is a feature release.
Command line flag -locations now triggers the generation of the identifiers
xleft and xright in the actions section instead of left and right.
Both are of type ComplexSymbolFactory.Location instead of plain ints.
M. Petter
Technische Universität München
2014/02/26
------------------------------------------------------------------------
CUP version 0.11b beta 20140220 is a feature release.
Main switch statement now splits the action code in bundles of 300 productions
on several different method bodies. Should fix the 65k size boundary problem
M. Petter
Technische Universität München
2014/02/20
------------------------------------------------------------------------
CUP version 0.11a beta 20060608 is a bugfix release.
......
......@@ -185,14 +185,28 @@ action code {:
}
}
}
private int cur_debug_id = 0;
public int get_new_debug_id() {
return cur_debug_id++;
}
public String attach_debug_symbol(int id, String code) {
if (!parser.debugSymbols)
return code;
return "//@@CUPDBG" + id + "\n" + code;
}
:};
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
parser code {:
/* override error routines */
protected Lexer lexer;
public boolean debugSymbols;
public void setDebugSymbols(boolean debugSymbols){
this.debugSymbols = debugSymbols;
}
public void report_fatal_error(
String message,
Object info)
......@@ -230,7 +244,7 @@ terminal
PACKAGE, IMPORT, CODE, ACTION, PARSER, TERMINAL, NON, INIT, SCAN, WITH,
START, SEMI, COMMA, STAR, DOT, COLON, COLON_COLON_EQUALS, BAR, PRECEDENCE,
LEFT, RIGHT, NONASSOC, PERCENT_PREC, LBRACK, RBRACK, NONTERMINAL, GT, LT,
QUESTION, SUPER, EXTENDS;
QUESTION, SUPER, EXTENDS, CLASS;
terminal String ID, CODE_STRING;
......@@ -242,7 +256,7 @@ non terminal
type_id, term_name_list, non_term_name_list, production, prod_part_list,
prod_part, new_term_id, new_non_term_id, rhs_list, rhs, empty,
precedence_list, preced, terminal_list, precedence_l, declares_term,
declares_non_term;
declares_non_term, class_name;
non terminal String nt_id, symbol_id, label_id, opt_label, terminal_id,
term_id, robust_id, typearglist, typearguement, wildcard;
......@@ -263,6 +277,7 @@ spec ::=
:}
package_spec
import_list
class_name
code_parts
symbol_list
precedence_list
......@@ -322,6 +337,15 @@ import_spec ::=
SEMI
;
class_name ::=
empty |
CLASS ID:id SEMI
{:
emit.parser_class_name = id;
emit.symbol_const_class_name = id + "Sym";
:}
;
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
// allow any order; all parts are optional. [CSA, 23-Jul-1999]
......@@ -339,7 +363,7 @@ action_code_part ::=
if (emit.action_code!=null)
ErrorManager.getManager().emit_warning("Redundant action code (skipping)");
else /* save the user included code string */
emit.action_code = user_code;
emit.action_code = attach_debug_symbol(get_new_debug_id(),user_code);
:}
;
......@@ -351,7 +375,7 @@ parser_code_part ::=
if (emit.parser_code!=null)
ErrorManager.getManager().emit_warning("Redundant parser code (skipping)");
else /* save the user included code string */
emit.parser_code = user_code;
emit.parser_code = attach_debug_symbol(get_new_debug_id(),user_code);
:}
;
......@@ -363,7 +387,7 @@ init_code ::=
if (emit.init_code!=null)
ErrorManager.getManager().emit_warning("Redundant init code (skipping)");
else /* save the user code */
emit.init_code = user_code;
emit.init_code = attach_debug_symbol(get_new_debug_id(),user_code);
:}
;
......@@ -375,7 +399,7 @@ scan_code ::=
if (emit.scan_code!=null)
ErrorManager.getManager().emit_warning("Redundant scan code (skipping)");
else /* save the user code */
emit.scan_code = user_code;
emit.scan_code = attach_debug_symbol(get_new_debug_id(),user_code);
:}
;
......@@ -534,7 +558,7 @@ start_spec ::=
new_rhs();
add_rhs_part(add_lab(new symbol_part(start_nt), "start_val"));
add_rhs_part(new symbol_part(terminal.EOF));
add_rhs_part(new action_part("RESULT = start_val;"));
if (!emit._xmlactions) add_rhs_part(new action_part("RESULT = start_val;"));
emit.start_production =
new production(non_terminal.START_nt, rhs_parts, rhs_pos);
new_rhs();
......@@ -621,7 +645,7 @@ rhs ::=
new_rhs();
add_rhs_part(add_lab(new symbol_part(start_nt),"start_val"));
add_rhs_part(new symbol_part(terminal.EOF));
add_rhs_part(new action_part("RESULT = start_val;"));
if (!emit._xmlactions) add_rhs_part(new action_part("RESULT = start_val;"));
if ((sym!=null) && (sym instanceof terminal)) {
emit.start_production =
new production(non_terminal.START_nt, rhs_parts,
......@@ -657,7 +681,7 @@ rhs ::=
new_rhs();
add_rhs_part(add_lab(new symbol_part(start_nt),"start_val"));
add_rhs_part(new symbol_part(terminal.EOF));
add_rhs_part(new action_part("RESULT = start_val;"));
if (!emit._xmlactions) add_rhs_part(new action_part("RESULT = start_val;"));
emit.start_production =
new production(non_terminal.START_nt, rhs_parts, rhs_pos);
......@@ -699,7 +723,7 @@ prod_part ::=
CODE_STRING:code_str
{:
/* add a new production part */
add_rhs_part(new action_part(code_str));
add_rhs_part(new action_part(attach_debug_symbol(get_new_debug_id(),code_str)));
:}
;
......
#! /bin/sh
#!/bin/sh
CLASSPATH="$CLASSPATH:/usr/share/java/cup.jar"
export CLASSPATH
......
cup (0.11b-20160615-1) unstable; urgency=medium
* Team upload.
* New upstream version 0.11b-20160615.
* Switch to compat level 11.
* Change the all versions to 0.11b.
* Convert debian/copyright to copyright format 1.0.
* Update build.patch for new release.
* Declare compliance with Debian Policy 4.2.1.
* Depend on java8-runtime-headless
-- Markus Koschany <apo@debian.org> Sun, 30 Sep 2018 23:30:46 +0200
cup (0.11a+20060608-8) unstable; urgency=medium
* Team upload.
......
......@@ -7,11 +7,11 @@ Uploaders:
Build-Depends:
ant,
cup (>= 0.11a),
debhelper (>= 9),
debhelper (>= 11),
default-jdk,
jflex (>= 1.6.1),
maven-repo-helper
Standards-Version: 3.9.8
Standards-Version: 4.2.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/cup.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/cup.git
Homepage: http://www2.cs.tum.edu/projects/cup/
......@@ -19,7 +19,7 @@ Homepage: http://www2.cs.tum.edu/projects/cup/
Package: cup
Architecture: all
Depends:
default-jre-headless | java1-runtime-headless | java2-runtime-headless,
default-jre-headless | java8-runtime-headless,
${misc:Depends}
Suggests:
java-compiler
......
This is the Debian GNU/Linux prepackaged version of CUP, a
parser generator for Java. It was debianized by Vincent Renardias
<vincent@waw.com> on Sun, 2 Feb 1997 07:03:45 +0100.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: CUP
Source: http://www2.cs.tum.edu/projects/cup/
Files-Excluded:
*.jar
It was downloaded from the CUP web page at
<URL:http://www.cs.princeton.edu/~appel/modern/java/CUP/>.
CUP PARSER GENERATOR COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
Copyright 1996 by Scott Hudson, Frank Flannery, C. Scott Ananian
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and
that both the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation, and that the names of
the authors or their employers not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
The authors and their employers disclaim all warranties with regard to
this software, including all implied warranties of merchantability and
fitness. In no event shall the authors or their employers be liable
for any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an
action of contract, negligence or other tortious action, arising out
of or in connection with the use or performance of this software.
Files: *
Copyright: 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter
License: CUP-License
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided that
the above copyright notice appear in all copies and that both the copyright
notice and this permission notice and warranty disclaimer appear in supporting
documentation, and that the names of the authors or their employers not be used
in advertising or publicity pertaining to distribution of the software without
specific, written prior permission.
.
The authors and their employers disclaim all warranties with regard to this
software, including all implied warranties of merchantability and fitness. In
no event shall the authors or their employers be liable for any special,
indirect or consequential damages or any damages whatsoever resulting from loss
of use, data or profits, whether in an action of contract, negligence or other
tortious action, arising out of or in connection with the use or performance of
this software. This is an open source license. It is also GPL-Compatible (see
entry for "Standard ML of New Jersey"). The portions of CUP output which are
hard-coded into the CUP source code are (naturally) covered by this same
license, as is the CUP runtime code linked with the generated parser.
.
Java is a trademark of Sun Microsystems, Inc. References to the Java
programming language in relation to JLex are not meant to imply that Sun
endorses this product.
dist/java-cup-0.11a.jar usr/share/java
debian/bin/cup usr/bin
dist/java-cup-0.11b.jar usr/share/java
dist/java-cup-11b-runtime.jar usr/share/java
debian/bin/cup usr/bin
/usr/share/java/java-cup-0.11a.jar /usr/share/java/cup.jar
/usr/share/java/java-cup-0.11a.jar /usr/share/maven-repo/net/sf/squirrel-sql/thirdparty-non-maven/java-cup/0.11a/java-cup-0.11a.jar
/usr/share/java/java-cup-0.11b.jar /usr/share/java/cup.jar
/usr/share/java/java-cup-0.11b.jar /usr/share/maven-repo/net/sf/squirrel-sql/thirdparty-non-maven/java-cup/0.11b/java-cup-0.11b.jar
debian/pom.xml --usj-name=cup --usj-version=0.11a --artifact=dist/java-cup-0.11a.jar
debian/pom.xml --usj-name=cup --usj-version=0.11b --artifact=dist/java-cup-0.11b.jar
From: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Date: Wed, 27 Jul 2016 12:05:26 +0200
Subject: build
===================================================================
---
build.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.xml b/build.xml
index 705edd6..ae8138c 100644
--- a/build.xml
+++ b/build.xml
@@ -53,7 +53,7 @@
<target name="compile" depends="jflex">
<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">
+ <javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.3" target="1.3">
<classpath refid="libraries"/>
</javac>
</target>
From: Markus Koschany <apo@debian.org>
Date: Sun, 30 Sep 2018 21:42:15 +0200
Subject: build
---
build.xml | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/build.xml b/build.xml
index 91bd60c..d464a96 100644
--- a/build.xml
+++ b/build.xml
@@ -21,26 +21,6 @@
<mkdir dir="${dist}" />
<loadfile property="cupversion" srcFile="version.txt" failonerror="false" />
<property name="cupversion" value="custombuild" unless:set="cupversion"/>
- <exec executable="git" outputproperty="gitversion">
- <arg value="log"/>
- <arg value="-1"/>
- <arg value="--format=%h"/>
- </exec>
- <exec executable="git" outputproperty="changed">
- <arg value="status"/>
- <arg value="--porcelain"/>
- <redirector>
- <outputfilterchain>
- <linecontainsregexp>
- <regexp pattern='^M.*'/>
- </linecontainsregexp>
- <tokenfilter>
- <replaceregex pattern=".*" replace="modifications based on "/>
- </tokenfilter>
- </outputfilterchain>
- </redirector>
- </exec>
- <property name="svnversion">${changed}${gitversion}</property>
</target>
<property environment="env" />
@@ -79,7 +59,7 @@
<copy todir="${java}"><fileset dir="${src}"></fileset></copy>
<replace file="${java}/java_cup/version.java"
token="+ version_str"
- value='+ "v0.11b ${cupversion} (GIT ${svnversion})"'>
+ value='+ "v0.11b ${cupversion}"'>
</replace>
<javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.8" target="1.8">
<classpath refid="libraries"/>
Description: Fixes the compatibility with the version of JFlex in Debian
Author: Markus Koschany <apo@debian.org>, Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
From: Markus Koschany <apo@debian.org>
Date: Mon, 1 Oct 2018 00:02:28 +0200
Subject: jflex 1.6.1
Fixes the compatibility with the version of JFlex in Debian
---
build.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build.xml b/build.xml
index d464a96..d3dba25 100644
--- a/build.xml
+++ b/build.xml
@@ -41,14 +41,14 @@
@@ -45,14 +45,14 @@
</target>
<taskdef name="cup" classname="java_cup.anttask.CUPTask" classpath="${bin}/java-cup-11.jar" />
......@@ -16,7 +24,7 @@ Forwarded: no
<target name="jflex" depends="cup">
- <jflex file="${flex}/Lexer.jflex" destdir="${java}" />
+ <jflex file="${flex}/Lexer.jflex" destdir="${java}" legacydot="on"/>
+ <jflex file="${flex}/Lexer.jflex" destdir="${java}" legacydot="on" />
</target>
<target name="compile" depends="jflex">
build.diff
build.patch
jflex-1.6.1.patch
......@@ -3,7 +3,7 @@
<groupId>net.sf.squirrel-sql.thirdparty-non-maven</groupId>
<artifactId>java-cup</artifactId>
<name>Java CUP Parser Generator</name>
<version>0.11a</version>
<version>0.11b</version>
<description>
CUP is a system for generating LALR parsers from simple specifications. It serves the same role as
the widely used program YACC [1] and in fact offers most of the features of YACC. However, CUP is
......
......@@ -3,14 +3,16 @@ export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/cup.jar:/usr/share/java/jflex.jar
%:
dh $@ --parallel --with maven-repo-helper --buildsystem=ant
dh $@ --with maven-repo-helper --buildsystem=ant
override_dh_install:
mv dist/java-cup-11a.jar dist/java-cup-0.11a.jar
if [ -f $(CURDIR)/dist/java-cup-11b.jar ]; then \
mv dist/java-cup-11b.jar dist/java-cup-0.11b.jar; \
fi
dh_install
override_dh_clean:
dh_clean
mh_clean
$(RM) dist/java-cup-0.11a.jar
$(RM) dist/java-cup-0.11b.jar
......@@ -23,11 +23,9 @@ import java.io.InputStreamReader;
private ComplexSymbolFactory symbolFactory;
private int csline,cscolumn;
public Symbol symbol(String name, int code){
// System.out.println("code:"+code+" "+yytext());
return symbolFactory.newSymbol(name, code,new Location(yyline+1,yycolumn+1-yylength()),new Location(yyline+1,yycolumn+1));
}
public Symbol symbol(String name, int code, String lexem){
// System.out.println("code:"+code+", lexem :"+lexem);
return symbolFactory.newSymbol(name, code, new Location(yyline+1, yycolumn +1), new Location(yyline+1,yycolumn+yylength()), lexem);
}
protected void emit_warning(String message){
......@@ -78,6 +76,7 @@ ident = ([:jletter:] | "_" ) ([:jletterdigit:] | [:jletter:] | "_" )*
"{:" { sb = new StringBuffer(); csline=yyline+1; cscolumn=yycolumn+1; yybegin(CODESEG); }
"package" { return symbol("PACKAGE",PACKAGE); }
"import" { return symbol("IMPORT",IMPORT); }
"class" { return symbol("CLASS",CLASS); }
"code" { return symbol("CODE",CODE); }
"action" { return symbol("ACTION",ACTION); }
"parser" { return symbol("PARSER",PARSER); }
......
CUP Parser Generator Copyright Notice, License, and Disclaimer
Copyright 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the names of the authors or their employers not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.
The authors and their employers disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the authors or their employers be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.
This is an open source license. It is also GPL-Compatible (see entry for "Standard ML of New Jersey"). The portions of CUP output which are hard-coded into the CUP source code are (naturally) covered by this same license, as is the CUP runtime code linked with the generated parser.
Java is a trademark of Sun Microsystems, Inc. References to the Java programming language in relation to JLex are not meant to imply that Sun endorses this product.
This diff is collapsed.
......@@ -54,6 +54,8 @@ import java_cup.runtime.*;
* <dd> turn on debugging messages within JavaCup
* <dt> -nopositions
* <dd> don't generate the positions code
* <dt> -locations
* <dd> generate handles xleft/xright for symbol positions in actions
* <dt> -noscanner
* <dd> don't refer to java_cup.runtime.Scanner in the parser
* (for compatibility with old runtimes)
......@@ -89,6 +91,8 @@ public class Main {
protected static boolean opt_show_timing = false;
/** User option -- do we run produce extra debugging messages */
protected static boolean opt_do_debug = false;
/** User option -- do eclipse debug symbols */
protected static boolean opt_do_debugsymbols = false;
/** User option -- do we compact tables by making most common reduce the
default action */
protected static boolean opt_compact_red = false;
......@@ -103,7 +107,10 @@ public class Main {
/* frankf added this 6/18/96 */
/** User option -- should generator generate code for left/right values? */
protected static boolean lr_values = true;
protected static boolean locations = false;
protected static boolean xmlactions = false;
protected static boolean genericlabels = false;
/** User option -- should symbols be put in a class or an interface? [CSA]*/
protected static boolean sym_interface = false;
......@@ -173,7 +180,10 @@ public class Main {
/* frankf 6/18/96
hackish, yes, but works */
emit.set_lr_values(lr_values);
/* open output files */
emit.set_locations(locations);
emit.set_xmlactions(xmlactions);
emit.set_genericlabels(genericlabels);
/* open output set_xmlactionsfiles */
if (print_progress) System.err.println("Opening files...");
/* use a buffered version of standard input */
input_file = new BufferedInputStream(System.in);
......@@ -248,6 +258,7 @@ public class Main {
System.err.println(message);
System.err.println();
System.err.println(
version.title_str + "\n" +
"Usage: " + version.program_name + " [options] [filename]\n" +
" and expects a specification file on standard input if no filename is given.\n" +
" Legal options include:\n" +
......@@ -263,6 +274,9 @@ public class Main {
" -nowarn don't warn about useless productions, etc.\n" +
" -nosummary don't print the usual summary of parse states, etc.\n" +
" -nopositions don't propagate the left and right token position values\n" +
" -locations generate handles xleft/xright for symbol positions in actions\n" +
" -xmlactions make the generated parser yield its parse tree as XML\n" +
" -genericlabels automatically generate labels to all symbols in XML mode\n" +
" -noscanner don't refer to java_cup.runtime.Scanner\n" +
" -progress print messages to indicate progress of the system\n" +
" -time print time usage summary\n" +
......@@ -358,8 +372,12 @@ public class Main {
opt_dump_states = opt_dump_tables = opt_dump_grammar = true;
else if (argv[i].equals("-time")) opt_show_timing = true;
else if (argv[i].equals("-debug")) opt_do_debug = true;
else if (argv[i].equals("-debugsymbols")) opt_do_debugsymbols = true;
/* frankf 6/18/96 */
else if (argv[i].equals("-nopositions")) lr_values = false;
else if (argv[i].equals("-locations")) locations = true;
else if (argv[i].equals("-xmlactions")) xmlactions = true;
else if (argv[i].equals("-genericlabels")) genericlabels = true;
/* CSA 12/21/97 */
else if (argv[i].equals("-interface")) sym_interface = true;
/* CSA 23-Jul-1999 */
......@@ -470,6 +488,7 @@ public class Main {
/* create a parser and parse with it */
ComplexSymbolFactory csf = new ComplexSymbolFactory();
parser_obj = new parser(new Lexer(csf),csf);
parser_obj.setDebugSymbols(opt_do_debugsymbols);
try {
if (opt_do_debug)
parser_obj.debug_parse();
......@@ -696,7 +715,7 @@ public class Main {
System.err.println(
"---------------------------------------------------- (" +
version.version_str + ")");
version.title_str + ")");
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
......
......@@ -55,7 +55,11 @@ public class CUPTask extends Task
private boolean dump=false;
private boolean time=false;
private boolean debug=false;
private boolean debugsymbols=false;
private boolean nopositions=false;
private boolean xmlactions=false;
private boolean genericlabels=false;
private boolean locations=true;
private boolean noscanner=false;
private boolean force=false;
private boolean quiet=false;
......@@ -88,7 +92,11 @@ public class CUPTask extends Task
if (dump) { sc.add("-dump"); }
if (time) { sc.add("-time"); }
if (debug) { sc.add("-debug"); }
if (debugsymbols) { sc.add("-debugsymbols"); }
if (nopositions) { sc.add("-nopositions"); }
if (locations) { sc.add("-locations"); }
if (genericlabels) { sc.add("-genericlabels"); }
if (xmlactions) { sc.add("-xmlactions"); }
if (noscanner) { sc.add("-noscanner"); }