Converted m4, bison, less, groff, textutils, sed, flex, binutils, fileutils, shellutils, gettext and net-tools to new layout.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2353 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2003-01-16 19:55:00 +00:00
|
|
|
<sect2><title> </title><para> </para></sect2>
|
2002-06-04 12:30:14 +01:00
|
|
|
|
Converted m4, bison, less, groff, textutils, sed, flex, binutils, fileutils, shellutils, gettext and net-tools to new layout.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2353 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2003-01-16 19:55:00 +00:00
|
|
|
<sect2><title>Descriptions</title>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2003-08-31 11:50:05 +01:00
|
|
|
<para>(Last checked against version &bison-contversion;.)</para>
|
2002-02-06 23:15:46 +00:00
|
|
|
|
Converted m4, bison, less, groff, textutils, sed, flex, binutils, fileutils, shellutils, gettext and net-tools to new layout.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2353 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
2003-01-16 19:55:00 +00:00
|
|
|
<sect3><title>Program file descriptions</title>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2002-02-06 23:15:46 +00:00
|
|
|
<sect4><title>bison</title>
|
2002-05-23 18:00:34 +01:00
|
|
|
<para>bison is a parser generator, a replacement for yacc. yacc stands for Yet
|
|
|
|
Another Compiler Compiler. What is bison then? It is a program that
|
2002-02-06 23:15:46 +00:00
|
|
|
generates a program that analyzes the structure of a text file. Instead of
|
2001-03-14 19:26:45 +00:00
|
|
|
writing the actual program a user specifies how things should be connected
|
2002-02-06 23:15:46 +00:00
|
|
|
and with those rules a program is constructed that analyzes the
|
2002-09-28 22:08:29 +01:00
|
|
|
text file. There are a lot of examples where structure is needed and
|
2002-02-06 23:15:46 +00:00
|
|
|
one of them is the calculator.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Given the string :</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<blockquote><literallayout> 1 + 2 * 3</literallayout></blockquote>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>A human can easily come to the result 7. Why? Because of the structure.
|
2001-03-20 08:33:53 +00:00
|
|
|
Our brain knows
|
2002-05-23 18:00:34 +01:00
|
|
|
how to interpret the string. The computer doesn't know that and bison is a
|
2001-01-24 00:31:17 +00:00
|
|
|
tool to help it understand by presenting the string in the following way
|
2001-07-22 20:45:10 +01:00
|
|
|
to the compiler:</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<blockquote><literallayout> +
|
2001-01-24 00:31:17 +00:00
|
|
|
/ \
|
|
|
|
* 1
|
|
|
|
/ \
|
2001-07-22 20:45:10 +01:00
|
|
|
2 3</literallayout></blockquote>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Starting at the bottom of a tree and coming across the numbers 2 and
|
2001-03-14 19:26:45 +00:00
|
|
|
3 which are joined by the multiplication symbol, the computer
|
2001-01-24 00:31:17 +00:00
|
|
|
multiplies 2 and 3. The result of that multiplication is remembered and
|
|
|
|
the next thing that the computer sees is the result of 2*3 and the
|
|
|
|
number 1 which are joined by the add symbol. Adding 1 to the previous
|
2002-09-28 22:08:29 +01:00
|
|
|
result makes 7. In calculating, the most complex calculations can be
|
2001-01-24 00:31:17 +00:00
|
|
|
broken down in this tree format and the computer just starts at the
|
2001-11-07 15:42:16 +00:00
|
|
|
bottom and works its way up to the top and comes with the correct
|
2002-05-23 18:00:34 +01:00
|
|
|
answer. Of course, bison isn't only used for calculators
|
2002-02-06 23:15:46 +00:00
|
|
|
alone.</para></sect4>
|
|
|
|
|
|
|
|
<sect4><title>yacc</title>
|
2003-01-08 22:12:05 +00:00
|
|
|
<para>This bash script calls bison using the -y option. This is for
|
|
|
|
compatibility purposes for programs which use yacc instead of
|
|
|
|
bison.</para></sect4>
|
2002-02-06 23:15:46 +00:00
|
|
|
|
|
|
|
</sect3>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|