• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H03-May-2022-6,2825,380

pccts/H23-Jul-2005-2,7192,085

progs/H03-May-2022-2,3381,470

src/H03-May-2022-10,5706,478

tests/H03-May-2022-1,8481,397

AUTHORSH A D04-Apr-20050

COPYINGH A D16-May-200517.6 KiB341281

ChangeLogH A D23-Jul-20054.5 KiB14892

INSTALLH A D04-Apr-20057.6 KiB184143

Makefile.amH A D08-Apr-2005146 64

Makefile.inH A D03-May-202217.4 KiB564481

NEWSH A D04-Apr-20050

READMEH A D04-Apr-20059.4 KiB249183

TODOH A D22-Jul-20051.2 KiB3023

acinclude.m4H A D04-Apr-20052.1 KiB7866

aclocal.m4H A D23-Jul-2005248.1 KiB7,1266,331

btparse.pc.inH A D08-Apr-2005217 1310

config.guessH A D19-Jun-200543.2 KiB1,4961,285

config.subH A D19-Jun-200530.8 KiB1,5711,429

configureH A D23-Jul-2005706.6 KiB22,54018,217

configure.acH A D08-Apr-20051.3 KiB7049

depcompH A D16-May-200513.4 KiB473299

install-shH A D04-Apr-20055.5 KiB251152

ltmain.shH A D19-Jun-2005181.6 KiB6,5015,121

missingH A D16-May-200510 KiB337263

mkinstalldirsH A D16-May-20051.9 KiB11285

README

1                                  btparse
2                    (a C library to parse BibTeX files)
3
4                               version 0.34
5                             25 October, 2003
6                       Greg Ward (gward@python.net)
7
8Copyright (c) 1997-2003 by Gregory P. Ward.  All rights reserved.
9
10This library is free software; you can redistribute it and/or modify it
11under the terms of the GNU Library General Public License as published by
12the Free Software Foundation; either version 2 of the License, or (at your
13option) any later version.
14
15This library is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
18License for more details.
19
20(Please note that this licence statement only covers the source files in
21the top-level distribution directory.  Source files in the "progs" and "t"
22sub-directories are covered by either the GNU Library General Public
23License (getopt.c, getopt1.c, and getopt.h, which come from the GNU C
24Library) or the GNU General Public Licence (all other files, which were
25written by me).  The files in the "pccts" subdirectory are part of PCCTS
261.33, and were written (for the most part) by Terence Parr.  They are *not*
27covered by either GNU licence.  In all cases, consult each file for the
28appropriate copyright and licensing information.)
29
30
31INTRODUCTION
32------------
33
34btparse is the C component of btOOL, a pair of libraries for parsing and
35processing BibTeX files.  Its primary use is as the back-end to my
36Text::BibTeX library for Perl (the other half of btOOL), but there's
37nothing to prevent you from writing C programs using btparse -- or from
38writing extensions to other high-level languages using btparse as a
39back-end.  There's even copious documentation on using the library in
40the "doc" directory.
41
42btparse is built on top of a lexical analyzer and parser constructed
43using PCCTS (the Purdue Compiler Construction Tool Set), which provides
44efficient, reliable parsing with excellent error detection, reporting,
45and recovery.  The library provides entry points to the parser,
46functions to traverse and query the abstract-syntax tree that it
47produces, and some functions for processing strings in "the BibTeX way".
48The only requirement for building the library is an ANSI-compliant C
49compiler.  In particular, you do *not* need PCCTS, because enough of it
50is included in the distribution to build btparse.  (Of course, if you
51play with the grammar file (bibtex.g), then you will need PCCTS to
52re-build the library.  If you do this, though, you should know what
53you're doing and already have PCCTS.)
54
55
56AVAILABILITY
57------------
58
59You can find the latest version of both components of btOOL (btparse and
60Text::BibTeX), as well as up-to-date information on btOOL, at:
61
62    http://www.gerg.ca/software/btOOL/
63
64Here you will find HTML versions of the documentation, a technical
65report describing the project, links to download the code, and whatever
66other goodies I can come up with over time.
67
68The software is also available in my author directory on any CPAN
69(Comprehensive Perl Archive Network) site, e.g.
70
71    http://www.cpan.org/modules/by-authors/id/GWARD/
72    http://search.cpan.org/~gward/btparse-0.34/
73
74or on any CTAN (Comprehensive TeX Archive Network) site, in the
75biblio/bibtex/utils/btOOL/ directory, e.g.
76
77    ftp://ftp.ctan.org/tex-archive/biblio/bibtex/utils/btOOL/
78
79
80BUILDING
81--------
82
83To build the library (which you will have to do in any case, even if you
84just want to use it through my Perl module), do the following:
85
86  ./configure
87  make
88
89(See the file INSTALL for more details on running the configure script.)
90
91To run the test suite:
92
93  make check
94
95If any of the tests fail, please contact me and let me know.
96
97If you're just doing this in order to build Text::BibTeX, you're done --
98go back to the Text::BibTeX README for further instructions.
99
100If you're building btparse for use in your own C programs, you'll
101probably want to install the library (shared and static):
102
103  make install
104
105This installs the following files under the 'prefix' directory supplied
106to 'configure' (default: "/usr"):
107
108  bin/bibparse
109  lib/libbtparse.la
110  lib/libbtparse.so.0.0.0
111  lib/libbtparse.a
112  man/man3/bt_format_names.3
113  man/man3/bt_traversal.3
114  man/man3/bt_language.3
115  man/man3/bt_input.3
116  man/man3/bt_macros.3
117  man/man3/bt_misc.3
118  man/man3/bt_postprocess.3
119  man/man3/bt_split_names.3
120  man/man3/btparse.3
121  include/btparse.h
122
123
124BUILDING FROM CVS
125-----------------
126
127If you're building from the CVS repository rather than from a source
128distribution, run these commands first:
129
130  aclocal
131  libtoolize --force
132  automake --foreign --add-missing
133  autoconf
134
135Then carry on as above, ie. run "./configure" and so forth.
136
137(At least, this works for me.  It requires GNU Automake (1.6 or later)
138and GNU Autoconf.)
139
140
141DOCUMENTATION
142-------------
143
144In the "doc" directory you will find several man pages covering all
145aspects of btparse.  Even if you're not planning on using the library
146from C, you might be interested in the bt_language page, which covers
147the lexical and syntactic grammars that btparse uses to parse BibTeX.
148
149The documentation is written using the pod (plain ol' documentation)
150format, but *roff-ready versions (Unix man pages) are included with the
151distribution.  These are the versions that will be installed by `make
152install', so (as long as the INSTALL_MAN directory from Makefile.defs is
153in your manual page search path), you should be able to access the
154documentation using the "man" command.
155
156If you have Perl 5 installed, you can use one of the pod converters
157supplied with it to read or print the documentation; try pod2text,
158pod2man, pod2html, or pod2latex.
159
160If you'd like the documentation in ready-to-print PostScript form, I
161have written a technical report describing btOOL, with the btparse and
162Text::BibTeX documentation included as appendices.  The whole report is
163just over 100 pages, around 30 of which make up the btparse
164documentation (the Text::BibTeX documentation is a further 45 pages).
165It can be downloaded from the same location as the btOOL code:
166
167    http://www.aseonline.net/~gward/btOOL/
168
169I may also make the btparse and Text::BibTeX manuals available as
170separate PostScript files, but they aren't there as of this writing.
171
172Finally, HTML versions of both the technical report and the two
173documentation sets are (or soon will be) available at the btOOL web
174site:
175
176   http://starship.python.net/~gward/btOOL/
177
178If you find the documentation useful and would like to see more, please
179let me know.
180
181
182EXAMPLE PROGRAMS
183----------------
184
185Included in the "progs" directory are three example programs, bibparse,
186biblex, and dumpnames.  bibparse provides an example of a well-behaved,
187useful program based on btparse; by default, it reads a series of BibTeX
188files (named on the command line), parses them, and prints their data
189out in a form that is dead easy to parse in almost any language.  (I
190used this as a preliminary to the full-blown Text::BibTeX Perl module;
191to parse BibTeX data, I just opened a pipe reading the output of
192bibparse, and used simple Perl code to parse the data.)  bibparse uses
193GNU getopt, but I've included the necessary files with the distribution
194so you shouldn't have any problems building it.
195
196biblex is an example of what *not* to do; it rudely pokes into the
197internals of both the library and the PCCTS-generated lexical scanner on
198which it is based.  It prints out the stream of tokens in a BibTeX file
199according to my lexical grammar.  Do *not* use this program as an
200example!  I found it useful in debugging the lexical analyzer and
201parser, and provide it solely for your amusement.
202
203dumpnames is, for variety, well-behaved.  It uses the name-splitting
204algorithm supplied in the library (which emulates BibTeX's behaviour) to
205chop up lists of names and individual names, and dumps all such names
206found in any 'editor' or 'author' fields in a BibTeX file.
207
208These programs are unsupported, under-commented, and undocumented (apart
209from the above paragraphs).  If you would like this to change, tell me
210about it -- if nobody except me is interested in them, then unsupported
211and undocumented they will remain.
212
213
214CREDITS
215-------
216
217Thanks are due to the following people:
218
219  * for pointing out and helping to debug problems with the build process:
220      Jason Christian <jason@primal.ucdavis.edu>
221      Reiner Schlotte <schlotte@geo.palmod.uni-bremen.de>
222      Denis Bergquist <djbergquist@ccgate.hac.com>
223
224  * for reporting bugs (and in some cases, fixing them) and suggesting
225    changes in the library:
226      Reiner Schlotte <schlotte@geo.palmod.uni-bremen.de>
227      St�phane Genaud <genaud@icps.u-strasbg.fr>
228      Claus Wilke <claus.wilke@gmx.net>
229
230  * for sage wisdom, the voice of experience, and inspiration:
231      Oren Patashnik <opbibtex@labrea.Stanford.EDU>
232      Gerd Neugebauer <gerd@mailhost.uni-koblenz.de>
233      Nelson H. F. Beebe <beebe@math.utah.edu>
234
235
236BUGS AND LIMITATIONS
237--------------------
238
239See the "BUGS AND LIMITATIONS" section of the btparse(3) man page (in the
240"doc/" subdirectory) for details.  Executive summary: due to a heavy
241dependence on global variables in the parser and lexical scanner, btparse
242is not even remotely thread-safe.  Furthermore, you can't have two files
243open and being parsed at the same time; any attempt to do so is an illegal
244use of the library and will result in your program crashing.
245
246Other bugs should be reported to me: Greg Ward <gward@python.net>.
247
248$Id: README 741 2005-04-04 01:00:55Z greg $
249