[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison Success Stories?
Re: Bison Success Stories?
Thu, 14 Feb 2002 12:08:37 +0100
Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)
>>>>> "Pascal" == Pascal Bart <address@hidden> writes:
>> My company is using Bison on a project for a very particular
>> customer. If we use non-commercial software we have to somehow
>> 'prove' that the software works (because if it doesn't they have no
>> one blame, it's stupid, I know). The best way I can come up with
>> to show that Bison is the reliable tool I know it to be is to list
>> some commercial applications where Bison is used, preferably
>> something with a safety aspect to it.
Pascal> Bison is working fine, its generated parser are used in mysql,
Pascal> bash, gcc, and more, but I would to remember you that Bison
Pascal> generated parsers are under GPL license, so it cann't be
Pascal> include in a commercial application, because GPL source code
Pascal> can _only_ be used in a GPL application, for more information
Pascal> see http://www.gnu.org/licenses/gpl.txt.
This is *wrong*.
Thanks God, this is dead wrong: read the f*g license!
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
Conditions for Using Bison
As of Bison version 1.24, we have changed the distribution terms for
`yyparse' to permit using Bison's output in nonfree programs.
Formerly, Bison parsers could be used only in programs that were free
The other GNU programming tools, such as the GNU C compiler, have
never had such a requirement. They could always be used for nonfree
software. The reason Bison was different was not due to a special
policy decision; it resulted from applying the usual General Public
License to all of the Bison source code.
The output of the Bison utility--the Bison parser file--contains a
verbatim copy of a sizable piece of Bison, which is the code for the
`yyparse' function. (The actions from your grammar are inserted into
this function at one point, but the rest of the function is not
changed.) When we applied the GPL terms to the code for `yyparse', the
effect was to restrict the use of Bison output to free software.
We didn't change the terms because of sympathy for people who want to
make software proprietary. *Software should be free.* But we
concluded that limiting Bison's use to free software was doing little to
encourage people to make other software free. So we decided to make the
practical conditions for using Bison match the practical conditions for
using the other GNU tools.
Now, to answer the question, I'd submit the following paragraph.
What is Bison
Yacc is a generator of efficient parsers. A "parser" is a program
or routine which recognizes the structure of sentences. Yacc's input is
composed of "rules" with associated actions. The rules must be
"context free", i.e., their left hand side is composed of a single
nonterminal symbol, and their right hand side is composed of series of
terminal and nonterminal symbols. When a rule is reduced, the
associated C code is triggered.
Yacc is based on pushdown automata. It is a implementation of the
LALR(1) parsing algorithm, which is sufficient for most programming
languages, but can be too limited a framework to describe conveniently
Yacc, and all its declinations (CAMLYacc for CAML etc.) are used in
numerous applications, especially compilers and interpreters. Hence its
name: Yet Another Compiler Compiler.
Bison is a free software implementation of Yacc, as described by the
POSIX standard. It provides a wide set of additional options and
features, produces self contained portable code (no library is
required), supports a more pleasant syntax, and stands as a standard of
its own. Since most Yacc do have problems (inter-Yacc compatibility and
actual bugs), all the reasons are in favor of using exclusively Bison:
the portable C code it produces can be shipped in the package and will
compile cleanly on the user's machine. It imposes no restriction on the
license of the produced parser.
It is used by the GNU Compiler Collection for C, C++(1), the C
preprocessor. Many other programming language tools use Bison or Yacc:
GNU AWK, Perl, but it proves itself useful in reading structured files:
a2ps uses it to parse its style sheets. It also helps decoding some
limited forms of natural language: numerous GNU utilities use a Yacc
grammar to decode dates such as `2 days ago', `3 months 1 day', `25
Dec', `1970-01-01 00:00:01 UTC +5 hours' etc.
GNU Gettext deserves a special mention with three different uses:
one to parse its input files, another one to parse the special comments
in these files, and one to evaluate the foreign language dependent rules
defining the plural forms.