Commit 9af5d11c authored by Tobias C. Rittweiler's avatar Tobias C. Rittweiler
Browse files

Make the library releasable.

darcs-hash:e94185fe2b174251f956c4458f9764a43a03636b
parent 76ad1141
Copyright (c) 2008, Tobias C. Rittweiler <tcr@freebits.de>
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the names of Tobias C. Rittweiler nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY Tobias C. Rittweiler ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Tobias
C. Rittweiler BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
......@@ -155,35 +155,35 @@ info_tgz_size="`calcsize $outdir/$PACKAGE.info.tar.gz`"
# do not mv the info files, there's no point in having them available
# separately on the web.
cmd="${TEXI2DVI} $srcfile"
echo "Generating dvi ... ($cmd)"
eval $cmd
# now, before we compress dvi:
echo Generating postscript...
${DVIPS} $PACKAGE -o
gzip -f -9 $PACKAGE.ps
ps_gz_size="`calcsize $PACKAGE.ps.gz`"
mv $PACKAGE.ps.gz $outdir/
# compress/finish dvi:
gzip -f -9 $PACKAGE.dvi
dvi_gz_size="`calcsize $PACKAGE.dvi.gz`"
mv $PACKAGE.dvi.gz $outdir/
cmd="${TEXI2DVI} --pdf $srcfile"
echo "Generating pdf ... ($cmd)"
eval $cmd
pdf_size="`calcsize $PACKAGE.pdf`"
mv $PACKAGE.pdf $outdir/
cmd="${MAKEINFO} -o $PACKAGE.txt --no-split --no-headers $srcfile"
echo "Generating ASCII... ($cmd)"
eval $cmd
ascii_size="`calcsize $PACKAGE.txt`"
gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
ascii_gz_size="`calcsize $outdir/$PACKAGE.txt.gz`"
mv $PACKAGE.txt $outdir/
# cmd="${TEXI2DVI} $srcfile"
# echo "Generating dvi ... ($cmd)"
# eval $cmd
# # now, before we compress dvi:
# echo Generating postscript...
# ${DVIPS} $PACKAGE -o
# gzip -f -9 $PACKAGE.ps
# ps_gz_size="`calcsize $PACKAGE.ps.gz`"
# mv $PACKAGE.ps.gz $outdir/
# # compress/finish dvi:
# gzip -f -9 $PACKAGE.dvi
# dvi_gz_size="`calcsize $PACKAGE.dvi.gz`"
# mv $PACKAGE.dvi.gz $outdir/
# cmd="${TEXI2DVI} --pdf $srcfile"
# echo "Generating pdf ... ($cmd)"
# eval $cmd
# pdf_size="`calcsize $PACKAGE.pdf`"
# mv $PACKAGE.pdf $outdir/
# cmd="${MAKEINFO} -o $PACKAGE.txt --no-split --no-headers $srcfile"
# echo "Generating ASCII... ($cmd)"
# eval $cmd
# ascii_size="`calcsize $PACKAGE.txt`"
# gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
# ascii_gz_size="`calcsize $outdir/$PACKAGE.txt.gz`"
# mv $PACKAGE.txt $outdir/
# Print a SED expression that will translate references to MANUAL to
# the proper page on gnu.org. This is a horrible shell hack done
......
......@@ -4,6 +4,12 @@ u\input texinfo @c -*- Mode: Texinfo; Mode: auto-fill -*-
@settitle Parse-Declarations API Documentation
@exampleindent 2
@c The header of this texinfo file was taken and adapted from CFFI's
@c manual which was written by James Bielman, Luis Oliveira, and
@c Stephen Compall.
@c @documentencoding utf-8
@c Style notes:
......@@ -158,50 +164,24 @@ software or the use or other dealings in the software.}
@contents
@ifnottex
@node Top
@node Top, Introduction, (dir), (dir)
@top Parse-Declarations API Documentation
@insertcopying
@end ifnottex
@menu
* Introduction::
* API::
* Examples::
* Glossary::
* Comprehensive Index::
@ignore
@detailmenu
--- Dictionary ---
API
* analyze-declaration-specifier:: Split a declaration specifier into parts.
* build-declaration-specifier:: Build a declaration specifier from parts.
* build-declarations:: Build declaration specifiers from a declaration-env.
* check-declaration-env:: Checks a declaration-env for certain properties.
* declaration-env:: Container for declaration specifiers.
* declaration-env-p:: Soup-p?
* declaration-env.policy:: Returns optimize qualities of a declaration-env.
* delcaration-env.affected-variables:: Returns binding names affected by a declaration-env.
* filter-declaration-env:: Filter a declaration env according to different criteria.
* map-declaration-env:: Map a function over a declaration-env.
* merge-declaration-envs:: Merge two declaration envs together.
* parse-body:: Parses @code{&body} argument into forms, decls, docstring.
* parse-declarations:: Parses declaration specifiers and returns a declaration-env.
@end detailmenu
@end ignore
* Introduction::
* API::
* Examples::
* Glossary::
* Comprehensive Index::
@end menu
@c ===================================================================
@c CHAPTER: Introduction
@node Introduction
@node Introduction, API, Top, Top
@chapter Introduction
The Introduction.
......@@ -209,15 +189,32 @@ The Introduction.
@c ===================================================================
@c CHAPTER: API
@node API
@node API, Examples, Introduction, Top
@chapter API
The API.
@menu
* analyze-declaration-specifier::
* build-declaration-specifier::
* build-declarations::
* check-declaration-env::
* declaration-env::
* declaration-env-p::
* declaration-env.affected-variables::
* declaration-env.policy::
* filter-declaration-env::
* map-declaration-env::
* merge-declaration-envs::
* parse-body::
* parse-declarations::
@end menu
@c ===================================================================
@c ANALYZE-DECLARATION-SPECIFIER
@node analyze-declaration-specifier
@node analyze-declaration-specifier, build-declaration-specifier, API, API
@unnumberedsec analyze-declaration-specifier
@subheading Syntax
@GenericFunction{analyze-declaration-specifier declaration-identifier declaration-args compilation-env
......@@ -332,7 +329,7 @@ with an @uref{@value{CLHS}/t_eql.htm, @code{EQL}} specializer.
@c ===================================================================
@c BUILD-DECLARATION-SPECIFIER
@node build-declaration-specifier
@node build-declaration-specifier, build-declarations, analyze-declaration-specifier, API
@unnumberedsec build-declaration-specifier
@subheading Syntax
@GenericFunction{build-declaration-specifier declaration-identifier affected-variables context
......@@ -422,7 +419,7 @@ PARSE-DECLARATIONS> (let ((spec '((string 512) variable)))
@c ===================================================================
@c BUILD-DECLARATIONS
@node build-declarations
@node build-declarations, check-declaration-env, build-declaration-specifier, API
@unnumberedsec build-declarations
@subheading Syntax
@Function{build-declarations tag &rest declaration-envs+ @res{} declarations-or-specifiers}
......@@ -481,7 +478,7 @@ symbol, or if any @var{declaration-env} is not a @ref{declaration-env}.
@c ===================================================================
@c CHECK-DECLARATION-ENV
@node check-declaration-env
@node check-declaration-env, declaration-env, build-declarations, API
@unnumberedsec check-declaration-env
@subheading Syntax
@Macro{check-declaration-env place &key unknown-allowed warn-only @res{} declaration-env}
......@@ -532,7 +529,7 @@ circumstances described above.
@c ===================================================================
@c DECLARATION-ENV
@node declaration-env
@node declaration-env, declaration-env-p, check-declaration-env, API
@unnumberedsec declaration-env
@subheading Syntax
......@@ -566,7 +563,7 @@ Use @ref{parse-declarations} instead.
@c ===================================================================
@c DECLARATION-ENV-P
@node declaration-env-p
@node declaration-env-p, declaration-env.affected-variables, declaration-env, API
@unnumberedsec build-declarations
@subheading Syntax
@Function{declaration-env-p declaration-env @res{} bool}
......@@ -596,7 +593,7 @@ None.
@c ===================================================================
@c DECLARATION-ENV.AFFECTED-VARIABLES
@node declaration-env.affected-variables
@node declaration-env.affected-variables, declaration-env.policy, declaration-env-p, API
@unnumberedsec declaration-env.affected-variables
@subheading Syntax
@Function{declaration-env.affected-variables declaration-env &optional allowed-decl-ids @res{} binding-names}
......@@ -663,7 +660,7 @@ first value.
@c ===================================================================
@c DECLARATION-ENV.POLICY
@node declaration-env.policy
@node declaration-env.policy, filter-declaration-env, declaration-env.affected-variables, API
@unnumberedsec declaration-env.policy
@subheading Syntax
@Function{declaration-env.policy declaration-env @res{} policy}
......@@ -708,7 +705,7 @@ Signals an error of type @uref{@value{CLHS}/e_tp_err.htm, @code{TYPE-ERROR}} if
@c ===================================================================
@c FILTER-DECLARATION-ENV
@node filter-declaration-env
@node filter-declaration-env, map-declaration-env, declaration-env.policy, API
@unnumberedsec filter-declaration-env
@subheading Syntax
@Function{filter-declaration-env declenv &key affecting not-affecting (include :everything) exclude filter-function
......@@ -842,7 +839,7 @@ If no @code{&key} parameter is given, @ref{filter-declaration-env} will return a
@c ===================================================================
@c MAP-DECLARATION-ENV
@node map-declaration-env
@node map-declaration-env, merge-declaration-envs, filter-declaration-env, API
@unnumberedsec map-declaration-env
@subheading Syntax
@Function{map-declaration-env function declaration-env @res{} result-env}
......@@ -900,7 +897,7 @@ specifier} in a different way), they should locally use @ref{map-declaration-env
@c ===================================================================
@c MERGE-DECLARATION-ENVS
@node merge-declaration-envs
@node merge-declaration-envs, parse-body, map-declaration-env, API
@unnumberedsec merge-declaration-envs
@subheading Syntax
@Function{merge-declaration-envs declaration-env1 declaration-env2 @res{} result-env}
......@@ -951,7 +948,7 @@ Signals an error of type @uref{@value{CLHS}/e_tp_err.htm, @code{TYPE-ERROR}} if
@c ===================================================================
@c PARSE-BODY
@node parse-body
@node parse-body, parse-declarations, merge-declaration-envs, API
@unnumberedsec parse-body
@subheading Syntax
@Function{parse-body body-and-decls &key documentation whole @res{} body, declarations, docstring}
......@@ -1034,7 +1031,7 @@ hence be referenced directly, or imported explicitly, if users don't want to use
@c ===================================================================
@c PARSE-DECLARATIONS
@node parse-declarations
@node parse-declarations, , parse-body, API
@unnumberedsec parse-declarations
@subheading Syntax
@Function{parse-declarations declarations-or-specifiers &optional compilation-env &key nostrip
......@@ -1089,7 +1086,7 @@ functions @ref{analyze-declaration-specifier} and @ref{build-declaration-specifi
@c ===================================================================
@c CHAPTER: Examples
@node Examples
@node Examples, Glossary, API, Top
@chapter Examples
A few examples.
......@@ -1100,7 +1097,7 @@ A few examples.
(cond ((symbolp binding) `(,binding nil))
((null (cdr binding)) `(,(car binding) nil))
(t binding))))
(multiple-value-bind (real-body decls) (alexandria:parse-body body :documentation nil)
(multiple-value-bind (real-body decls) (parse-declarations::parse-body body :documentation nil)
(let ((decl-env (parse-declarations decls macro-env)))
(check-declaration-env decl-env :unknown-allowed nil :warn-only t)
(labels ((generate-nested-lets (bindings &optional used-binding-names)
......@@ -1123,12 +1120,12 @@ A few examples.
(defmacro do ((&rest bindings) (end-test-form &body result-forms) &body decls-and-body
&environment macro-env)
(let ((loop-tag (gensym "DO-LOOP+")))
(multiple-value-bind (statements decls) (alexandria:parse-body decls-and-body)
(multiple-value-bind (statements decls) (parse-declarations::parse-body decls-and-body)
`(prog ,(loop for binding in bindings
collect (destructuring-bind (var &optional init step) binding
(declare (ignore step))
`(,var ,init)))
,@@(build-declarations 'declare (parse-declarations decls macro-env :strip t))
,@@(build-declarations 'declare (parse-declarations decls macro-env))
,loop-tag
(when ,end-test-form (return (progn ,@@result-forms)))
,@@statements
......@@ -1142,7 +1139,7 @@ A few examples.
@c ===================================================================
@c CHAPTER: Glossary
@node Glossary
@node Glossary, Comprehensive Index, Examples, Top
@appendix glossary
@table @dfn
......@@ -1200,7 +1197,7 @@ and which hence invokes its @uref{@value{CLHS}/26_glo_d.htm#default_method, defa
@end table
@node Comprehensive Index
@node Comprehensive Index, , Glossary, Top
@unnumbered Index
@printindex cp
......
......@@ -3,9 +3,7 @@
;;;
;;; All rights reserved.
;;;
;;; This file is published under a 3-clause BSD license (i.e. without
;;; advertisement clause.) See LICENSE for details.
;;;
;;; This file is published under MIT license. See LICENSE for details.
;;; The library Parse-Declarations comes with an elaborate manual
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment