--- kelbt-0.16.orig/aapl/avlcommon.h +++ kelbt-0.16/aapl/avlcommon.h @@ -920,7 +920,7 @@ long keyRelation; while (curEl) { - keyRelation = compare( *element, *curEl ); + keyRelation = Compare::compare( *element, *curEl ); /* Do we go left? */ if ( keyRelation < 0 ) --- kelbt-0.16.orig/aapl/bstcommon.h +++ kelbt-0.16/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; @@ -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; @@ -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.16.orig/debian/README.Debian +++ kelbt-0.16/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.16.orig/debian/changelog +++ kelbt-0.16/debian/changelog @@ -0,0 +1,42 @@ +kelbt (0.16-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Changed type for Parser_indicies from char to int8_t to fix + narrowing conversion issue with gcc-6 (closes: #837184) + + -- John Paul Adrian Glaubitz Sat, 07 Jan 2017 21:55:12 +0100 + +kelbt (0.16-1) unstable; urgency=medium + + * New upstream release + * Fixed watch file (closes: #796791) + * Fixes to debian/rules and debian/control towards lintian-cleanliness + * Bumped standards-version + + -- Robert Lemmen Mon, 06 Jun 2016 20:55:22 +0100 + +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.16.orig/debian/compat +++ kelbt-0.16/debian/compat @@ -0,0 +1 @@ +7 --- kelbt-0.16.orig/debian/control +++ kelbt-0.16/debian/control @@ -0,0 +1,36 @@ +Source: kelbt +Section: devel +Priority: extra +Maintainer: Robert Lemmen +Build-Depends: debhelper (>= 7) +Standards-Version: 3.9.8 + +Package: kelbt +Architecture: any +Depends: ${shlibs:Depends}, ${misc: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.16.orig/debian/copyright +++ kelbt-0.16/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.16.orig/debian/dirs +++ kelbt-0.16/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc --- kelbt-0.16.orig/debian/docs +++ kelbt-0.16/debian/docs @@ -0,0 +1,2 @@ +TODO +kelbt.vim --- kelbt-0.16.orig/debian/kelbt.1 +++ kelbt-0.16/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.16.orig/debian/rules +++ kelbt-0.16/debian/rules @@ -0,0 +1,71 @@ +#!/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 + +build-arch: build + +build-indep: build + +binary-indep: install + +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman debian/kelbt.1 + dh_link + dh_strip + dh_compress + 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.16.orig/debian/source/format +++ kelbt-0.16/debian/source/format @@ -0,0 +1 @@ +1.0 --- kelbt-0.16.orig/debian/watch +++ kelbt-0.16/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.colm.net/files/kelbt/ kelbt-(.*)\.tar\.gz --- kelbt-0.16.orig/kelbt.vim +++ kelbt-0.16/kelbt.vim @@ -0,0 +1,136 @@ +" Vim syntax file +" +" Language: Kelbt +" Author: Adrian Thurston + +syntax clear + +" +" Outside code +" + +" Comments +syntax region ocComment start="\/\*" end="\*\/" +syntax match ocComment "\/\/.*$" + +" Anything preprocessor +syntax match ocPreproc "#.*$" + +" Strings +syntax match ocLiteral "'\(\\.\|[^'\\]\)*'" +syntax match ocLiteral "\"\(\\.\|[^\"\\]\)*\"" + +" Keywords +syntax keyword ocType unsigned signed void char short int long float double bool +syntax keyword ocType inline static extern register const volatile auto +syntax keyword ocType union enum struct class typedef +syntax keyword ocType namespace template typename mutable +syntax keyword ocKeyword break continue default do else for +syntax keyword ocKeyword goto if return switch while +syntax keyword ocKeyword new delete this using friend public private protected sizeof +syntax keyword ocKeyword throw try catch operator typeid +syntax keyword ocKeyword and bitor xor compl bitand and_eq or_eq xor_eq not not_eq +syntax keyword ocKeyword static_cast dynamic_cast +syntax match ocObjCDirective "@public\|@private\|@protected" +syntax match ocObjCDirective "@interface\|@implementation" +syntax match ocObjCDirective "@class\|@end\|@defs" +syntax match ocObjCDirective "@encode\|@protocol\|@selector" + + +" Numbers +syntax match ocNumber "[0-9][0-9]*" +syntax match ocNumber "0x[0-9a-fA-F][0-9a-fA-F]*" + +" Booleans +syntax keyword ocBoolean true false + +" Identifiers +syntax match anyId "[a-zA-Z_][a-zA-Z_0-9]*" + +" Labels +syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contains=ocLabel +syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:]"me=e-1 contains=ocLabel +syntax match ocLabel "[a-zA-Z_][a-zA-Z_0-9]*" contained + +" Case Labels +syntax keyword ocCaseLabelKeyword case contained +syntax cluster ocCaseLabelItems contains=ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,ocCaseLabelKeyword,ocNumber,ocBoolean,anyId +syntax match ocCaseLabelColon "case" contains=@ocCaseLabelItems +syntax match ocCaseLabelColon "case[\t ]\+.*:$" contains=@ocCaseLabelItems +syntax match ocCaseLabelColon "case[\t ]\+.*:[^=:]"me=e-1 contains=@ocCaseLabelItems + + +" +" Kelbt sections +" + +" Parser Specification +syntax region parserSpec1 matchgroup=beginParser start="%%{" end="}%%" contains=@klItems +syntax region parserSpec2 matchgroup=beginParser start="%%[^{]"rs=e-1 end="$" keepend contains=@klItems +syntax region parserSpec3 matchgroup=beginParser start="%%$" end="$" keepend contains=@klItems + +" Items in kelbt sections +syntax cluster klItems contains=klComment,klLiteral,klKeywords,klCodeCurly,klCodeSemi,klNumber,anyId,klNonTerm,klWrite + +" Non-terminal +syntax match klNonTerm "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:" contained + +" Comments +syntax match klComment "#.*$" contained + +" Literals +syntax match klLiteral "'\(\\.\|[^'\\]\)*'" contained +syntax match klLiteral "\"\(\\.\|[^\"\\]\)*\"" contained +syntax match klLiteral /\/\(\\.\|[^\/\\]\)*\// contained +syntax match klLiteral "\[\(\\.\|[^\]\\]\)*\]" contained + +" Numbers +syntax match klNumber "[0-9][0-9]*" contained +syntax match klNumber "0x[0-9a-fA-F][0-9a-fA-F]*" contained + +" Keywords +syntax keyword klKeywords parser include token nonterm uses type translate try undo final commit pri class shortest contained + +" Write statements +syntax region klWrite matchgroup=Type start="\" matchgroup=NONE end=";" contained contains=klWriteWhat +syntax keyword klWriteWhat instance_data token_defs types data init exec finish contained + +" Inline items +syntax cluster inlineItems contains=klCodeCurly,ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,ocNumber,ocBoolean,ocLabelColon,anyId,ocCaseLabelColon,ilAccess + +" RHS Accessors in inline code +syntax match ilAccess "[\$@]\([\$@]\|[0-9]\+\)" contained + +" Blocks of code. klCodeCurly is recursive. +syntax region klCodeCurly matchgroup=NONE start="{" end="}" contained contains=@inlineItems +syntax region klCodeSemi matchgroup=Type start="\" matchgroup=NONE end=";" contained contains=@inlineItems + +" +" Sync at the start and end of parser specifications. +" +syntax sync match kelbtSyncPat grouphere NONE "%%{&" +syntax sync match kelbtSyncPat grouphere NONE "}%%" + +" +" Specifying Groups +" +hi link ocComment Comment +hi link ocPreproc Macro +hi link ocLiteral String +hi link ocType Type +hi link ocKeyword Keyword +hi link ocObjCDirective Keyword +hi link ocNumber Number +hi link ocBoolean Boolean +hi link ocCaseLabelKeyword Keyword +hi link ocLabel Label +hi link klComment Comment +hi link klNumber Number +hi link klLiteral String +hi link klKeywords Type +hi link klNonTerm Function +hi link klWriteWhat Keyword +hi link ilAccess Keyword +hi link beginParser Type + +let b:current_syntax = "kelbt" --- kelbt-0.16.orig/src/klparse.cpp +++ kelbt-0.16/src/klparse.cpp @@ -159,7 +159,7 @@ #line 160 "klparse.cpp" unsigned int Parser_startState = 0; -char Parser_indicies[] = { +int8_t Parser_indicies[] = { 50, 50, -1, 50, -1, 50, 50, -1, -1, -1, -1, -1, 50, -1, 50, 1, 0, 93, 3, 4, -1, 5, -1, 7,