--- byacc-j-1.15.orig/debian/compat +++ byacc-j-1.15/debian/compat @@ -0,0 +1 @@ +6 --- byacc-j-1.15.orig/debian/watch +++ byacc-j-1.15/debian/watch @@ -0,0 +1,3 @@ +version=3 +http://sf.net/byaccj/byaccj(.+)_src\.tar.gz \ + debian uupdate --- byacc-j-1.15.orig/debian/control +++ byacc-j-1.15/debian/control @@ -0,0 +1,28 @@ +Source: byacc-j +Maintainer: Ludovic Claude +Section: devel +Priority: extra +Standards-Version: 3.8.1 +Build-Depends: debhelper (>= 6), cdbs, quilt, cmake (>= 2.6) +Vcs-Bzr: lp:~ludovicc/uj/byacc-j +Vcs-Browser: http://bazaar.launchpad.net/~ludovicc/uj/byacc-j/files +Homepage: http://byaccj.sourceforge.net/ + +Package: byacc-j +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Berkeley YACC parser generator extended to generate Java code + BYACC/J is an extension of the Berkeley v 1.8 YACC-compatible parser + generator. + . + Standard YACC takes a YACC source file, and generates one or more C files from + it, which if compiled properly, will produce a LALR-grammar parser. This is + useful for expression parsing, interactive command parsing, and file reading. + Many megabytes of YACC code have been written over the years. + . + This is the standard YACC tool that is in use every day to produce C/C++ + parsers. + . + I have added a "-J" flag which will cause BYACC to generate Java source code, + instead. So there finally is a YACC for Java now! + --- byacc-j-1.15.orig/debian/prerm +++ byacc-j-1.15/debian/prerm @@ -0,0 +1,12 @@ +#! /bin/sh +# prerm script for byaccj + +set -e + +if [ $1 != "upgrade" ]; then + update-alternatives --remove yacc /usr/bin/byaccj +fi + +#DEBHELPER# + +exit 0 --- byacc-j-1.15.orig/debian/copyright +++ byacc-j-1.15/debian/copyright @@ -0,0 +1,34 @@ +Upstream source http://byaccj.sourceforge.net/ + +BYacc-J is in the public domain. + +Copyright 2000-2008 Tomas Hurka +Based on Bekerley Yacc v 0.91 + +Current byacc upstream maintainer: Thomas Dickey + +Public domain notice and no warranty: +------------------------------------------------------------------------------- + Berkeley Yacc is an LALR(1) parser generator. Berkeley Yacc has been made +as compatible as possible with AT&T Yacc. Berkeley Yacc can accept any input +specification that conforms to the AT&T Yacc documentation. Specifications +that take advantage of undocumented features of AT&T Yacc will probably be +rejected. + + Berkeley Yacc is distributed with no warranty whatever. The code +is certain to contain errors. Neither the author nor any contributor +takes responsibility for any consequences of its use. + + Berkeley Yacc is in the public domain. The data structures and algorithms +used in Berkeley Yacc are all either taken from documents available to the +general public or are inventions of the author. Anyone may freely distribute +source or binary forms of Berkeley Yacc whether unchanged or modified. +Distributers may charge whatever fees they can obtain for Berkeley Yacc. +Programs generated by Berkeley Yacc may be distributed freely. + + Please report bugs to + + robert.corbett@eng.Sun.COM + +Include a small example if possible. Please include the banner string from +skeleton.c with the bug report. Do not expect rapid responses. --- byacc-j-1.15.orig/debian/rules +++ byacc-j-1.15/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DEB_DH_INSTALL_SOURCEDIR = debian/tmp + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/cmake.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +PACKAGE := $(DEB_SOURCE_PACKAGE) +VERSION := $(DEB_UPSTREAM_VERSION) +MAN_PAGES := debian/byaccj.1 + +clean:: + rm -rf debian/tmp + +binary-post-install/$(PACKAGE):: + dh_installman $(MAN_PAGES) + +get-orig-source: + -uscan --force-download --rename + --- byacc-j-1.15.orig/debian/docs +++ byacc-j-1.15/debian/docs @@ -0,0 +1,2 @@ +docs/ACKNOWLEDGEMEN +docs/tf.y --- byacc-j-1.15.orig/debian/dirs +++ byacc-j-1.15/debian/dirs @@ -0,0 +1 @@ +usr/bin --- byacc-j-1.15.orig/debian/byaccj.1 +++ byacc-j-1.15/debian/byaccj.1 @@ -0,0 +1,167 @@ +.\" %W% %R% (Berkeley) %E% +.\" +.TH YACC 1 "July\ 15,\ 1990" +.UC 6 +.SH NAME +Yacc \- an LALR(1) parser generator for Java +.SH SYNOPSIS +.B byaccj [ -dlrtvJ ] [ -b +.I prefix +.B ] [-Jclass= +.I classname +.B ] [-Jpackage= +.I package_name +.B ] [-Jextends= +.I extends_name +.B ] [-Jimplements= +.I implements_name +.B ] [-Jsemantic= +.I semantic_type +.B ] [-Jnorun] [-Jnocontruct] [-Jstack= +.I NNN +.B ] [-Jnodebug] [-Jfinal] [-Jthrows= +.I exception_list +.B ] +.I filename +.SH DESCRIPTION +.I Yacc +reads the grammar specification in the file +.I filename +and generates an LR(1) parser for it. +The parsers consist of a set of LALR(1) parsing tables and a driver routine +written in the C programming language. +.I Yacc +normally writes the parse tables and the driver routine to the file +.IR y.tab.c. +.PP +The following options are available: +.RS +.TP +\fB-b \fIprefix\fR +The +.B -b +option changes the prefix prepended to the output file names to +the string denoted by +.IR prefix. +The default prefix is the character +.IR y. +.TP +.B -d +The \fB-d\fR option causes the header file +.IR y.tab.h +to be written. +.TP +.B -l +If the +.B -l +option is not specified, +.I yacc +will insert \#line directives in the generated code. +The \#line directives let the C compiler relate errors in the +generated code to the user's original code. +If the \fB-l\fR option is specified, +.I yacc +will not insert the \#line directives. +\&\#line directives specified by the user will be retained. +.TP +.B -r +The +.B -r +option causes +.I yacc +to produce separate files for code and tables. The code file +is named +.IR y.code.c, +and the tables file is named +.IR y.tab.c. +.TP +.B -t +The +.B -t +option changes the preprocessor directives generated by +.I yacc +so that debugging statements will be incorporated in the compiled code. +.TP +.B -v +The +.B -v +option causes a human-readable description of the generated parser to +be written to the file +.IR y.output. +.TP +.B -J +The +.B -J +option switches from C/C++ to Java output. Not necessary if other -J flags are used. +.TP +.B -Jclass= +Changes the name of the Java class (and .java file) to +.I classname +.TP +.B -Jpackage= + Changes the package in which the parser resides from the default to +.I packagename +.TP +.B -Jextends= + Changes the class the parser extends from the default to +.I extend_name +.TP +.B -Jimplements= + Changes the interface the parser implements from the default to +.I implement_name +.TP +.B -Jsemantic= + Changes the semantic (value of the rules' variables) type to +.I semantic_type. +No extra class will be generated. +.TP +.B -Jnorun +The +.B -Jnorun +option informs Byacc to not generate a run() method. Useful when working with threads. +.TP +.B -Jnoconstruct +The +.B -Jnoconstruct +option informs Byacc to not generate constructors. Useful when extending classes. +.TP +.B -Jstack= + Changes the stack size from default 500 to +.I NNN +.TP +.B -Jnodebug +The +.B -Jnodebug +option informs Byacc to omit debugging code for further better performance. +.TP +.B -Jfinal +The +.B -Jfinal +option makes generated class final. +.TP +.B -Jthrows= + Informs Byacc to declare thrown exceptions for yyparse() method. +.RE +.PP +If the environment variable TMPDIR is set, the string denoted by +TMPDIR will be used as the name of the directory where the temporary +files are created. +.SH FILES +.IR y.code.c +.br +.IR y.tab.c +.br +.IR y.tab.h +.br +.IR y.output +.br +.IR /tmp/yacc.aXXXXXX +.br +.IR /tmp/yacc.tXXXXXX +.br +.IR /tmp/yacc.uXXXXXX +.SH DIAGNOSTICS +If there are rules that are never reduced, the number of such rules is +reported on standard error. +If there are any LALR(1) conflicts, the number of conflicts is reported +on standard error. --- byacc-j-1.15.orig/debian/changelog +++ byacc-j-1.15/debian/changelog @@ -0,0 +1,6 @@ +byacc-j (1.15-1) unstable; urgency=low + + * Initial release (closes: 532933) + + -- Ludovic Claude Wed, 13 May 2009 20:59:05 +0100 + --- byacc-j-1.15.orig/debian/postinst +++ byacc-j-1.15/debian/postinst @@ -0,0 +1,15 @@ +#! /bin/sh +# postinst script for byaccj + +set -e + +if [ $1 != "upgrade" ] ; then + update-alternatives \ + --install /usr/bin/yacc yacc /usr/bin/byaccj 70 +# --slave /usr/share/man/man1/yacc.1.gz yaccman \ +# /usr/share/man/man1/byacc.1.gz +fi + +#DEBHELPER# + +exit 0 --- byacc-j-1.15.orig/debian/patches/main-mktemp-security.patch +++ byacc-j-1.15/debian/patches/main-mktemp-security.patch @@ -0,0 +1,51 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -82,12 +82,25 @@ + short **derives; + char *nullable; + ++#ifdef linux ++# define mktemp safe_mktemp ++extern void safe_mktemp(char *tmpl); ++#endif + + void done(int k) + { +- if (action_file) { fclose(action_file); unlink(action_file_name); } +- if (text_file) { fclose(text_file); unlink(text_file_name); } +- if (union_file) { fclose(union_file); unlink(union_file_name); } ++ if (action_file) ++ fclose(action_file); ++ if (action_file_name[0]) ++ unlink(action_file_name); ++ if (text_file) ++ fclose(text_file); ++ if (text_file_name[0]) ++ unlink(text_file_name); ++ if (union_file) ++ fclose(union_file); ++ if (union_file_name[0]) ++ unlink(union_file_name); + exit(k); + } + +@@ -535,6 +548,19 @@ + code_file = output_file; + } + ++#ifdef linux ++void ++safe_mktemp(char *fname) ++{ ++ int fd; ++ ++ if ((fd = mkstemp(fname)) < 0) { ++ perror("unable to create temp file"); ++ exit(1); ++ } ++ close(fd); ++} ++#endif + + int main(int argc,char **argv) + { --- byacc-j-1.15.orig/debian/patches/series +++ byacc-j-1.15/debian/patches/series @@ -0,0 +1,2 @@ +cmake.patch +main-mktemp-security.patch --- byacc-j-1.15.orig/debian/patches/cmake.patch +++ byacc-j-1.15/debian/patches/cmake.patch @@ -0,0 +1,19 @@ +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,6 @@ ++cmake_minimum_required(VERSION 2.6) ++ ++PROJECT(BYACCJ) ++ ++ADD_SUBDIRECTORY(src) ++#ADD_SUBDIRECTORY(test) +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,7 @@ ++include_directories (.) ++ ++set(byaccj_SRC closure.c lalr.c mkpar.c lr0.c skeleton.c verbose.c main.c symtab.c warshall.c ++ defs.h output.c error.c reader.c) ++add_executable(byaccj ${byaccj_SRC}) ++ ++install(TARGETS byaccj RUNTIME DESTINATION bin LIBRARY DESTINATION lib)