>I just start reading the book "flex & bison Text Processing Tools" by
>John Levine. Please excuse me if I ask some question that are
>available somewhere in the book. When the grammar become huge, it
>would be inconvenient put all BNFs in a single file. I'm wondering how
>a huge grammar is handled in bison?

Slowly.  Bison has no built in provision for handling multiple source
files, but it's easy enough to use something like soelim in your
Makefile to combine several files into one and hand it to bison.

>> For some languages, like Fortran, Bison/Flex are not a good at all.

Scanning Fortran with flex would be a losing battle, but once you have
a scanner, parsing it with bison isn't hard.  Here's a scanner and
parser for most of Fortran 77 that I wrote 20 years ago:

ftp://ftp.iecc.com/pub/file/ftn-grammar.gz

R's,
John


_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to