[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is Bison?



>   >What exactly is Bison?
>
>     Being an Indian, you ought to know, Amrit.  'Bison' is another term
>   for 'buffalo'.
>
>     Ooops! You're Asian Indian.  And you mean the _computer program_ Bison.
>   Oh.
>
>     Bison is a parser generator.

You're a geek Bazyar!  :-)

Bison is a replacement for yacc.  (Yet Another Compiler Compiler) Yacc
is used along with lex to generate programs which can parse syntax.
For example, you can use these tools to generate a compiler.  Or let's
say you have a game which needs to understand simple sentences:

] pick up cow from table.

You can use these tools to determine wether input is valid or with a
little bit of work, to understand the sentence.  (I use the term
understand in a limited sense here).

You basically use regular expressions with lex to recognize various
tokens or words.  Then you use bison to make sure that those tokens
are in correct order by specifying those rules in BNF form.  I think
bison can use ll(1) grammars.

It's actually a UNIX command, so you can type man bison in your UNIX
box and that should give you a little more info.

Nagendra

nagendra@csa.bu.edu