BISON: multiple parsers within a single program. (pendell)
19 Dec 2002 12:35:25 -0500

          From comp.compilers

Related articles
BISON: multiple parsers within a single program. (2002-12-19)
Re: BISON: multiple parsers within a single program. (Clint Olsen) (2002-12-22)
| List of all articles for this month |

From: (pendell)
Newsgroups: comp.compilers
Date: 19 Dec 2002 12:35:25 -0500
Keywords: parse, yacc, question
Posted-Date: 19 Dec 2002 12:35:25 EST

The Problem:
4 files.
File one is a list of objects and criteria.
File two is a list of file names which may match this criteria.

We read these two files to develop a master list of yet ANOTHER two
file types. We then read the new files from this list, which have the
following characteristics:

1. Contains a header and a body of data.
2. Data of different types -- some by keyword, some by position, some
by position relative to keyword. .
3. Some entries in type 1 may refer to multiple entries in type 2.

My solution:

Use Flex/Bison to generate four parsers, one for each file. I will
then build a driver which will direct the use of the parsers among the
files and store the collected data in central data structures.


Does this sound like a feasible approach? Or is FLEX/BISON going to
do something strange? Are there some gotchas lurking in the weeds
that I'm not aware of? I've never tried multiple parsers within a
single program before, and although the documentation for Bison says
it's possible -- I wonder. I'd really like a second opinion before I
go off and spend a week trying to implement something before finding
out I've wasted my time.


Many thanks for any assistance you can offer.


Brian P.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.