Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #877
| From | Torsten Eichstädt <torsten.eichstaedt@FernUni-Hagen.de> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: parsing bibtex file with flex/bison |
| Date | 2013-03-25 13:41 +0100 |
| Organization | FernUni Hagen |
| Message-ID | <13-03-016@comp.compilers> (permalink) |
| References | <13-03-003@comp.compilers> <13-03-004@comp.compilers> <13-03-006@comp.compilers> <13-03-013@comp.compilers> |
Rudra Banerjee wrote:
> The problem is, how I integrate this two code, i.e. put the $1, $3 of "
> KEY '=' VALUE ',' { printf("%s : %s\n",$1, $3); };" in the hash table.
RTFM man scanf ???
And for a more complete "real" program you may want to insert error handling
in your code, i.e. detect syntax errors and things like file not found etc..
Do I remember right that bison/flex info docs contain good hints how
to do that? Or there is a good HOWTO or docs in
/usr/share/doc/flex/bison or you search the net (some years past since
I wrote a parser w/ flex/bison). From my experience it is good to do
so (latest) once you have a working outline (frame), and it looks like
you have one. Do not make it too detailed, though, to not fog your
"real" code too much. Very likely you can subsume error cases for a
simple program.
Personally, I like the approach to start writing test cases and then fill in
the real code to fulfill the requirements. This helps you to make sure you
do not miss s/th and in many cases unveils simple flaws _early_ that we
usually insert when programming. I.e. you start w/ a program that fails --
but it tells you why! Then, step by step, your program solves the
requirements until you're satisfied (according to the test
cases/requirements). E.g.
/* very (too) simple implementation */
#ifdef TESTING
check( requirement_1 )
#endif
--
=|o)
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
parsing bibtex file with flex/bison bnrj.rudra@gmail.com - 2013-03-04 15:48 -0800
Re: parsing bibtex file with flex/bison Evangelos Drikos <drikosev@otenet.gr> - 2013-03-06 13:45 +0200
Re: parsing bibtex file with flex/bison Rudra Banerjee <bnrj.rudra@gmail.com> - 2013-03-07 11:20 +0000
Re: parsing bibtex file with flex/bison Rudra Banerjee <bnrj.rudra@gmail.com> - 2013-03-17 00:18 +0000
Re: parsing bibtex file with flex/bison Torsten Eichstädt <torsten.eichstaedt@FernUni-Hagen.de> - 2013-03-25 13:41 +0100
Re: parsing bibtex file with flex/bison glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-03-08 03:59 +0000
csiph-web