--- kelbt-0.15.orig/debian/dirs +++ kelbt-0.15/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc --- kelbt-0.15.orig/debian/docs +++ kelbt-0.15/debian/docs @@ -0,0 +1,3 @@ +TODO +cxxprep +kelbt.vim --- kelbt-0.15.orig/debian/control +++ kelbt-0.15/debian/control @@ -0,0 +1,36 @@ +Source: kelbt +Section: devel +Priority: extra +Maintainer: Robert Lemmen +Build-Depends: debhelper (>= 7) +Standards-Version: 3.8.3 + +Package: kelbt +Architecture: any +Depends: ${shlibs:Depends} +Description: backtracking LR parser generator + Kelbt generates backtracking LALR(1) parsers. Standard LALR(1) parser + generators emit an error upon encountering a conflict in the parse tables. + Kelbt forges onward, generating parsers which handle conflicts by backtracking + at runtime. Kelbt is able to generate a parser for any context-free grammar and + therefore implements a generalized parsing method. + . + Kelbt is different from other backtracking LR systems in two ways. First, it + elevates backtracking to the level of semantic actions by introducing a class + of actions called undo actions. Undo actions are invoked as the backtracker + undoes parsing and allow the user to revert any side effects of forward + semantic actions. This makes it possible to backtrack over language constructs + which must modify global state in preparation for handling context + dependencies. + . + Second, Kelbt enables a user-controlled parsing strategy which approximates + that of generalized recursive-descent parsing with ordered choice. This makes + it easy for the user to resolve language ambiguities by ordering the grammar + productions of a non-terminal according to precedence. It is approximate in the + sense that for most grammars the equivalent of an ordered choice parsing + strategy is achieved. In cases where productions are parsed out of the order + given, there is a simple grammar transformation which remedies the problem. + . + As a proof of concept, Kelbt has been used to write a partial C++ parser + (included) which is composed of strictly a scanner, a name lookup stage and a + grammar with standard semantic actions and semantic undo actions. --- kelbt-0.15.orig/debian/compat +++ kelbt-0.15/debian/compat @@ -0,0 +1 @@ +7 --- kelbt-0.15.orig/debian/changelog +++ kelbt-0.15/debian/changelog @@ -0,0 +1,26 @@ +kelbt (0.15-1) unstable; urgency=low + + * New upstream release + + -- Robert Lemmen Wed, 30 May 2012 19:49:11 +0100 + +kelbt (0.14-1) unstable; urgency=low + + * New upstream release + + -- Robert Lemmen Mon, 12 Oct 2009 10:05:34 +0100 + +kelbt (0.13-1) unstable; urgency=low + + * New upstream release + * Fixed watch file + + -- Robert Lemmen Thu, 12 Mar 2009 19:35:16 +0000 + +kelbt (0.12-1) unstable; urgency=low + + * Initial release (Closes: #440823) + * Added licensing info for aapl + + -- Robert Lemmen Tue, 4 Sep 2007 17:11:25 +0200 + --- kelbt-0.15.orig/debian/copyright +++ kelbt-0.15/debian/copyright @@ -0,0 +1,19 @@ +This package was debianized by Robert Lemmen on +Tue, 4 Sep 2007 17:11:25 +0200. + +It was downloaded from http://www.cs.queensu.ca/~thurston/kelbt/ + +Upstream Author: Adrian Thurston + +Copyright: 2006-2012 Adrian Thurston + +License: + +Kelbt is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + +The AAPL library, which is also included in this package, is also (C) Adrian +Thurston and licensed under the LGPL, see +`/usr/share/common-licenses/LGPL-2.1'. + +The Debian packaging is (C) 2007, Robert Lemmen and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- kelbt-0.15.orig/debian/watch +++ kelbt-0.15/debian/watch @@ -0,0 +1,5 @@ +# Compulsory line, this is a version 3 file +version=3 + +#http://www.cs.queensu.ca/~thurston/kelbt/ kelbt-(.*)\.tar\.gz +http://www.complang.org/kelbt/ kelbt-(.*)\.tar\.gz --- kelbt-0.15.orig/debian/README.Debian +++ kelbt-0.15/debian/README.Debian @@ -0,0 +1,9 @@ +kelbt paper +----------- + +The author of Kelbt has written a rather nice paper, which is really helpful +when trying to understand kelbt. Unfortunately it can't be distributed with this +package because of licensing issues, but you can get it from +http://www.cs.queensu.ca/~thurston/thurston_CASCON_06_btlr.pdf + + -- Robert Lemmen , Thu, 6 Sep 2007 09:15:23 +0100 --- kelbt-0.15.orig/debian/kelbt.1 +++ kelbt-0.15/debian/kelbt.1 @@ -0,0 +1,31 @@ +.TH KELBT 1 "May 2007" "Kelbt 0.12" "Backtracking LR Parser Generator" +.SH NAME +kelbt \- generate backtracking LR parsers +.SH SYNOPSIS +.B kelbt +.RI [ options ] files +.SH DESCRIPTION +This manual page very briefly documents \fBkelbt\fP, a backtracking LR parser +generator. For a better reference on how to use it, see the provided examples +and the paper at http://www.cs.queensu.ca/~thurston/thurston_CASCON_06_btlr.pdf + +.SH OPTIONS +.TP +.BR \-h ", " \-H ", " \-? ", " \-\-help +Print this usage and exit +.TP +.B \-v, \-\-version +Print version information and exit +.B \-o " file" +Write output to file +.B \-V +Generate a Graphviz dotfile +.B \-i +Show branch point info +.B \-t +Force top-down with unique empty productions +.B \-l +Inhibit writing of #line directives + +.SH AUTHOR +kelbt was written by Adrian Thurston . --- kelbt-0.15.orig/debian/rules +++ kelbt-0.15/debian/rules @@ -0,0 +1,70 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g $(shell dpkg-buildflags --get CPPFLAGS) +LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" + + +build: build-stamp + +build-stamp: config.status + dh_testdir + $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs $(LDFLAGS)" + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) prefix=$(CURDIR)/debian/kelbt/usr install + +binary-indep: build install + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman debian/kelbt.1 + dh_link + dh_strip + # hack to remove unnecessary files + rm debian/kelbt/usr/share/doc/kelbt/cxxprep/COPYING + dh_compress -Xcxxprep + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- kelbt-0.15.orig/cxxprep/Makefile +++ kelbt-0.15/cxxprep/Makefile @@ -33,7 +33,7 @@ # Programs CXX = c++ AR = ar -KELBT = ../kelbt/kelbt +KELBT = kelbt RAGEL = ragel RLCODEGEN = rlgen-cd @@ -44,7 +44,7 @@ # Rules. all: cxxprep undo -cxxprep: $(KELBT) $(CC_HEADERS) $(CC_SRCS) $(OBJS) +cxxprep: $(CC_HEADERS) $(CC_SRCS) $(OBJS) $(CXX) $(LDFLAGS) -o $@ $(OBJS) undo: undo.lex @@ -54,9 +54,9 @@ keys.cpp: keys.gperf gperf -L C++ -t $< > $@ -parser.h: parser.kh $(KELBT) +parser.h: parser.kh $(KELBT) -o $@ $< -parser.cpp: parser.kl parser.kh $(KELBT) +parser.cpp: parser.kl parser.kh $(KELBT) -o $@ $< --- kelbt-0.15.orig/aapl/bstcommon.h +++ kelbt-0.15/aapl/bstcommon.h @@ -361,7 +361,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(key, GET_KEY(*mid)); + keyRelation = Compare::compare(key, GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; @@ -373,12 +373,12 @@ lower = mid - 1; while ( lower != lowEnd && - compare(key, GET_KEY(*lower)) == 0 ) + Compare::compare(key, GET_KEY(*lower)) == 0 ) lower--; upper = mid + 1; while ( upper != highEnd && - compare(key, GET_KEY(*upper)) == 0 ) + Compare::compare(key, GET_KEY(*upper)) == 0 ) upper++; low = (Element*)lower + 1; @@ -419,7 +419,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(key, GET_KEY(*mid)); + keyRelation = Compare::compare(key, GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; @@ -457,7 +457,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(key, GET_KEY(*mid)); + keyRelation = Compare::compare(key, GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; @@ -508,7 +508,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(key, GET_KEY(*mid)); + keyRelation = Compare::compare(key, GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; @@ -603,7 +603,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(GET_KEY(el), GET_KEY(*mid)); + keyRelation = Compare::compare(GET_KEY(el), GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; @@ -662,7 +662,7 @@ } mid = lower + ((upper-lower)>>1); - keyRelation = compare(GET_KEY(el), GET_KEY(*mid)); + keyRelation = Compare::compare(GET_KEY(el), GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; --- kelbt-0.15.orig/aapl/avlcommon.h +++ kelbt-0.15/aapl/avlcommon.h @@ -881,9 +881,9 @@ } #ifdef AVL_BASIC - keyRelation = compare( *element, *curEl ); + keyRelation = Compare::compare( *element, *curEl ); #else - keyRelation = compare( element->BASEKEY(getKey()), + keyRelation = Compare::compare( element->BASEKEY(getKey()), curEl->BASEKEY(getKey()) ); #endif @@ -920,7 +920,7 @@ long keyRelation; while (curEl) { - keyRelation = compare( *element, *curEl ); + keyRelation = Compare::compare( *element, *curEl ); /* Do we go left? */ if ( keyRelation < 0 ) @@ -969,7 +969,7 @@ return element; } - keyRelation = compare( key, curEl->BASEKEY(getKey()) ); + keyRelation = Compare::compare( key, curEl->BASEKEY(getKey()) ); /* Do we go left? */ if ( keyRelation < 0 ) { @@ -1023,7 +1023,7 @@ return element; } - keyRelation = compare(key, curEl->getKey()); + keyRelation = Compare::compare(key, curEl->getKey()); /* Do we go left? */ if ( keyRelation < 0 ) { @@ -1058,7 +1058,7 @@ long keyRelation; while (curEl) { - keyRelation = compare( key, curEl->BASEKEY(getKey()) ); + keyRelation = Compare::compare( key, curEl->BASEKEY(getKey()) ); /* Do we go left? */ if ( keyRelation < 0 )