From 978d0bffc413b67ead9db2d2816b916cf3d502ca Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Wed, 24 Sep 2003 22:29:16 +0000 Subject: Changing the style of the command descriptions in appendix A. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2879 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- appendixa/bison-desc.xml | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) (limited to 'appendixa/bison-desc.xml') diff --git a/appendixa/bison-desc.xml b/appendixa/bison-desc.xml index 1a749dd50..49ffbcd1c 100644 --- a/appendixa/bison-desc.xml +++ b/appendixa/bison-desc.xml @@ -6,46 +6,12 @@ Program file descriptions -bison -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 -generates a program that analyzes the structure of a text file. Instead of -writing the actual program a user specifies how things should be connected -and with those rules a program is constructed that analyzes the -text file. There are a lot of examples where structure is needed and -one of them is the calculator. - -Given the string : - -
1 + 2 * 3
- -A human can easily come to the result 7. Why? Because of the structure. -Our brain knows -how to interpret the string. The computer doesn't know that and bison is a -tool to help it understand by presenting the string in the following way -to the compiler: - -
+ - / \ - * 1 - / \ - 2 3
- -Starting at the bottom of a tree and coming across the numbers 2 and -3 which are joined by the multiplication symbol, the computer -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 -result makes 7. In calculating, the most complex calculations can be -broken down in this tree format and the computer just starts at the -bottom and works its way up to the top and comes with the correct -answer. Of course, bison isn't only used for calculators -alone.
- -yacc -This bash script calls bison using the -y option. This is for -compatibility purposes for programs which use yacc instead of -bison. +bison generates, from a series of rules, a program +for analyzing the structure of text files. Bison is a replacement for yacc +(Yet Another Compiler Compiler). + +yacc is a wrapper for bison, meant for programs +that still call yacc instead of bison. It calls bison with the -y option.
-- cgit v1.2.3-54-g00ecf