| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 | <sect2><title>Contents</title><para>The Bison package contains the bison program.</para></sect2><sect2><title>Description</title><para>Bison is a parser generator, a replacement for YACC. YACC stands for YetAnother Compiler Compiler. What is Bison then? It is a program thatgenerates a program that analyses the structure of a textfile. Insteadofwriting the actual program a user specifies how things should be connectedand withthose rules a program is constructed that analyses the textfile.</para><para>There are alot of examples where structure is needed and one of them isthecalculator.</para><para>Given the string :</para><blockquote><literallayout>        1 + 2 * 3</literallayout></blockquote><para>You can easily come to the result 7. Why ? Because of the structure. Youknowhow to interpretet the string. The computer doesn't know that and Bisonis atool to help it understand by presenting the string in the following wayto the compiler:</para><blockquote><literallayout>            +           / \          *   1         / \        2   3</literallayout></blockquote><para>Starting at the bottom of a tree and coming across the numbers 2 and3 which are joined by the multiplication symbol, the computermultiplies 2 and 3. The result of that multiplication is remembered andthe next thing that the computer sees is the result of 2*3 and thenumber 1 which are joined by the add symbol. Adding 1 to the previousresult makes 7. In calculating the most complex calculations can bebroken down in this tree format and the computer just starts at thebottom and works it's way up to the top and comes with the correctanswer. Of course, Bison isn't only used for calculators alone.</para></sect2>
 |