Relicense some taken-from-GNU Guile LGPLv3+ files to GPLv3+.

* mes/module/mes/pmatch.scm: Relicense to GPLv3+.
* mes/module/sxml/xpath.scm: Likewise.
* mes/module/mes/peg/cache.scm: Likewise.
* mes/module/mes/peg/codegen.scm: Likewise.
* mes/module/mes/peg/simplify-tree.scm: Likewise.
* mes/module/mes/peg/string-peg.scm: Likewise.
* mes/module/mes/peg/using-parsers.scm: Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2018-07-26 20:47:46 +02:00
parent a2d54958ff
commit 6c7b391e32
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
7 changed files with 151 additions and 132 deletions

View File

@ -1,23 +1,23 @@
;;; -*-scheme-*- ;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;
;;; This file is part of GNU Mes.
;;;
;;; GNU Mes is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Mes 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 General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;; cache.scm --- cache the results of parsing ;;; Taken from GNU Guile
;;;; ;;; cache.scm --- cache the results of parsing
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;;
;;;; 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;;;;
(define-module (ice-9 peg cache) (define-module (ice-9 peg cache)
#:export (cg-cached-parser)) #:export (cg-cached-parser))

View File

@ -1,21 +1,24 @@
;;;; codegen.scm --- code generation for composable parsers ;;; GNU Mes --- Maxwell Equations of Software
;;;; ;;; Copyright (C) 2011 Free Software Foundation, Inc.
;;;; Copyright (C) 2011 Free Software Foundation, Inc. ;;;
;;;; ;;; This file is part of GNU Mes.
;;;; This library is free software; you can redistribute it and/or ;;;
;;;; modify it under the terms of the GNU Lesser General Public ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;;; License as published by the Free Software Foundation; either ;;; under the terms of the GNU General Public License as published by
;;;; version 3 of the License, or (at your option) any later version. ;;; the Free Software Foundation; either version 3 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 ;;; GNU Mes is distributed in the hope that it will be useful, but
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; Lesser General Public License for more details. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; ;;; GNU 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 ;;; You should have received a copy of the GNU General Public License
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Taken from GNU Guile
;;; codegen.scm --- code generation for composable parsers
(define-module (ice-9 peg codegen) (define-module (ice-9 peg codegen)
#:export (compile-peg-pattern wrap-parser-for-users add-peg-compiler!) #:export (compile-peg-pattern wrap-parser-for-users add-peg-compiler!)
@ -174,7 +177,7 @@
(cggr accum 'cg-and #`(reverse #,body) at)) (cggr accum 'cg-and #`(reverse #,body) at))
((first rest ...) ((first rest ...)
#`(let ((res (#,(compile-peg-pattern #'first accum) #,str #,strlen #,at))) #`(let ((res (#,(compile-peg-pattern #'first accum) #,str #,strlen #,at)))
(and res (and res
;; update AT and BODY then recurse ;; update AT and BODY then recurse
(let ((newat (car res)) (let ((newat (car res))
(newbody (cadr res))) (newbody (cadr res)))

View File

@ -1,21 +1,24 @@
;;;; simplify-tree.scm --- utility functions for the PEG parser ;;; GNU Mes --- Maxwell Equations of Software
;;;; ;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. ;;;
;;;; ;;; This file is part of GNU Mes.
;;;; This library is free software; you can redistribute it and/or ;;;
;;;; modify it under the terms of the GNU Lesser General Public ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;;; License as published by the Free Software Foundation; either ;;; under the terms of the GNU General Public License as published by
;;;; version 3 of the License, or (at your option) any later version. ;;; the Free Software Foundation; either version 3 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 ;;; GNU Mes is distributed in the hope that it will be useful, but
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; Lesser General Public License for more details. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; ;;; GNU 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 ;;; You should have received a copy of the GNU General Public License
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Taken from GNU Guile
;;; simplify-tree.scm --- utility functions for the PEG parser
(define-module (ice-9 peg simplify-tree) (define-module (ice-9 peg simplify-tree)
#:export (keyword-flatten context-flatten string-collapse) #:export (keyword-flatten context-flatten string-collapse)

View File

@ -1,21 +1,24 @@
;;;; string-peg.scm --- representing PEG grammars as strings ;;; GNU Mes --- Maxwell Equations of Software
;;;; ;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. ;;;
;;;; ;;; This file is part of GNU Mes.
;;;; This library is free software; you can redistribute it and/or ;;;
;;;; modify it under the terms of the GNU Lesser General Public ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;;; License as published by the Free Software Foundation; either ;;; under the terms of the GNU General Public License as published by
;;;; version 3 of the License, or (at your option) any later version. ;;; the Free Software Foundation; either version 3 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 ;;; GNU Mes is distributed in the hope that it will be useful, but
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; Lesser General Public License for more details. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; ;;; GNU 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 ;;; You should have received a copy of the GNU General Public License
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Taken from GNU Guile
;;; string-peg.scm --- representing PEG grammars as strings
(define-module (ice-9 peg string-peg) (define-module (ice-9 peg string-peg)
#:export (peg-as-peg #:export (peg-as-peg
@ -270,4 +273,3 @@ RB < ']'
(else (error "Bad embedded PEG string" args)))) (else (error "Bad embedded PEG string" args))))
(add-peg-compiler! 'peg peg-string-compile) (add-peg-compiler! 'peg peg-string-compile)

View File

@ -1,21 +1,24 @@
;;;; using-parsers.scm --- utilities to make using parsers easier ;;; GNU Mes --- Maxwell Equations of Software
;;;; ;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. ;;;
;;;; ;;; This file is part of GNU Mes.
;;;; This library is free software; you can redistribute it and/or ;;;
;;;; modify it under the terms of the GNU Lesser General Public ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;;; License as published by the Free Software Foundation; either ;;; under the terms of the GNU General Public License as published by
;;;; version 3 of the License, or (at your option) any later version. ;;; the Free Software Foundation; either version 3 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 ;;; GNU Mes is distributed in the hope that it will be useful, but
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; Lesser General Public License for more details. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; ;;; GNU 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 ;;; You should have received a copy of the GNU General Public License
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Taken from GNU Guile
;;; using-parsers.scm --- utilities to make using parsers easier
(define-module (ice-9 peg using-parsers) (define-module (ice-9 peg using-parsers)
#:use-module (ice-9 peg simplify-tree) #:use-module (ice-9 peg simplify-tree)

View File

@ -1,23 +1,28 @@
;;; pmatch, a simple matcher ;;; pmatch, a simple matcher
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc ;;; Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc
;;; Copyright (C) 2005,2006,2007 Oleg Kiselyov ;;; Copyright (C) 2005,2006,2007 Oleg Kiselyov
;;; Copyright (C) 2007 Daniel P. Friedman ;;; Copyright (C) 2007 Daniel P. Friedman
;;; Copyright (C) 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright (C) 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This library is free software; you can redistribute it and/or ;;; This file is part of GNU Mes.
;;; modify it under the terms of the GNU Lesser General Public
;;; License as published by the Free Software Foundation; either
;;; version 3 of the License, or (at your option) any later version.
;;; ;;;
;;; This library is distributed in the hope that it will be useful, ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; under the terms of the GNU General Public License as published by
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; the Free Software Foundation; either version 3 of the License, or (at
;;; Lesser General Public License for more details. ;;; your option) any later version.
;;; ;;;
;;; You should have received a copy of the GNU Lesser General Public ;;; GNU Mes is distributed in the hope that it will be useful, but
;;; License along with this library; if not, write to the Free Software ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;; Taken from GNU Guile
;;; Originally written by Oleg Kiselyov for LeanTAP in Kanren, which is ;;; Originally written by Oleg Kiselyov for LeanTAP in Kanren, which is
;;; available under the MIT license. ;;; available under the MIT license.

View File

@ -1,23 +1,26 @@
;;;; (sxml xpath) -- SXPath ;;; GNU Mes --- Maxwell Equations of Software
;;;; ;;; Copyright (C) 2009 Free Software Foundation, Inc.
;;;; Copyright (C) 2009 Free Software Foundation, Inc. ;;; Modified 2004 by Andy Wingo <wingo at pobox dot com>.
;;;; Modified 2004 by Andy Wingo <wingo at pobox dot com>. ;;; Written 2001 by Oleg Kiselyov <oleg at pobox dot com> SXPath.scm.
;;;; Written 2001 by Oleg Kiselyov <oleg at pobox dot com> SXPath.scm. ;;;
;;;; ;;; This file is part of GNU Mes.
;;;; This library is free software; you can redistribute it and/or ;;;
;;;; modify it under the terms of the GNU Lesser General Public ;;; GNU Mes is free software; you can redistribute it and/or modify it
;;;; License as published by the Free Software Foundation; either ;;; under the terms of the GNU General Public License as published by
;;;; version 3 of the License, or (at your option) any later version. ;;; the Free Software Foundation; either version 3 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 ;;; GNU Mes is distributed in the hope that it will be useful, but
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; Lesser General Public License for more details. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; ;;; GNU 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 ;;; You should have received a copy of the GNU General Public License
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Taken from GNU Guile
;;; (sxml xpath) -- SXPath
;;; Commentary: ;;; Commentary:
;; ;;
@ -205,7 +208,7 @@
; take-until is a variation of the xpath:filter above: take-until passes ; take-until is a variation of the xpath:filter above: take-until passes
; elements of an ordered input set till (but not including) the first ; elements of an ordered input set till (but not including) the first
; element that satisfies the predicate. ; element that satisfies the predicate.
; The nodeset returned by ((take-until (not pred)) nset) is a subset -- ; The nodeset returned by ((take-until (not pred)) nset) is a subset --
; to be more precise, a prefix -- of the nodeset returned by ; to be more precise, a prefix -- of the nodeset returned by
; ((xpath:filter pred) nset) ; ((xpath:filter pred) nset)
@ -258,7 +261,7 @@
; Reverses the order of nodes in the nodeset ; Reverses the order of nodes in the nodeset
; This basic converter is needed to implement a reverse document order ; This basic converter is needed to implement a reverse document order
; (see the XPath Recommendation). ; (see the XPath Recommendation).
(define node-reverse (define node-reverse
(lambda (node-or-nodeset) (lambda (node-or-nodeset)
(if (not (nodeset? node-or-nodeset)) (list node-or-nodeset) (if (not (nodeset? node-or-nodeset)) (list node-or-nodeset)
(reverse node-or-nodeset)))) (reverse node-or-nodeset))))
@ -306,7 +309,7 @@
(define (select-kids test-pred?) (define (select-kids test-pred?)
(lambda (node) ; node or node-set (lambda (node) ; node or node-set
(cond (cond
((null? node) node) ((null? node) node)
((not (pair? node)) '()) ; No children ((not (pair? node)) '()) ; No children
((symbol? (car node)) ((symbol? (car node))
@ -330,7 +333,7 @@
(lambda (nodeset) ; Nodeset or node (lambda (nodeset) ; Nodeset or node
(let loop ((nodeset nodeset) (selectors selectors)) (let loop ((nodeset nodeset) (selectors selectors))
(if (null? selectors) nodeset (if (null? selectors) nodeset
(loop (loop
(if (nodeset? nodeset) (if (nodeset? nodeset)
(map-union (car selectors) nodeset) (map-union (car selectors) nodeset)
((car selectors) nodeset)) ((car selectors) nodeset))
@ -361,7 +364,7 @@
; (define (node-or . converters) ; (define (node-or . converters)
; (lambda (node-or-nodeset) ; (lambda (node-or-nodeset)
; (if (null? converters) node-or-nodeset ; (if (null? converters) node-or-nodeset
; (append ; (append
; ((car converters) node-or-nodeset) ; ((car converters) node-or-nodeset)
; ((apply node-or (cdr converters)) node-or-nodeset))))) ; ((apply node-or (cdr converters)) node-or-nodeset)))))
; More optimal implementation follows ; More optimal implementation follows
@ -389,7 +392,7 @@
; this point further iterations will no longer affect the result and ; this point further iterations will no longer affect the result and
; can be stopped. ; can be stopped.
(define (node-closure test-pred?) (define (node-closure test-pred?)
(lambda (node) ; Nodeset or node (lambda (node) ; Nodeset or node
(let loop ((parent node) (result '())) (let loop ((parent node) (result '()))
(if (null? parent) result (if (null? parent) result
@ -436,7 +439,7 @@
; (sxpath '()) -> (node-join) ; (sxpath '()) -> (node-join)
; (sxpath '(path-component ...)) -> ; (sxpath '(path-component ...)) ->
; (node-join (sxpath1 path-component) (sxpath '(...))) ; (node-join (sxpath1 path-component) (sxpath '(...)))
; (sxpath1 '//) -> (node-or ; (sxpath1 '//) -> (node-or
; (node-self (node-typeof? '*any*)) ; (node-self (node-typeof? '*any*))
; (node-closure (node-typeof? '*any*))) ; (node-closure (node-typeof? '*any*)))
; (sxpath1 '(equal? x)) -> (select-kids (node-equal? x)) ; (sxpath1 '(equal? x)) -> (select-kids (node-equal? x))
@ -473,7 +476,7 @@
(loop ((select-kids (apply node-eq? (cdar path))) nodeset) (loop ((select-kids (apply node-eq? (cdar path))) nodeset)
(cdr path))) (cdr path)))
((pair? (car path)) ((pair? (car path))
(let reducer ((nodeset (let reducer ((nodeset
(if (symbol? (caar path)) (if (symbol? (caar path))
((select-kids (node-typeof? (caar path))) nodeset) ((select-kids (node-typeof? (caar path))) nodeset)
(loop nodeset (caar path)))) (loop nodeset (caar path))))