Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: parsing bibtex file with flex/bison Date: Fri, 8 Mar 2013 03:59:36 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 24 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-03-007@comp.compilers> References: <13-03-003@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1362757158 41569 64.57.183.58 (8 Mar 2013 15:39:18 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 8 Mar 2013 15:39:18 +0000 (UTC) Keywords: parse Posted-Date: 08 Mar 2013 10:39:18 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:868 bnrj.rudra@gmail.com wrote: > I want to parse bibtex file using flex/bison. A sample bibtex is: > @Book{a1, > author="amook", > Title="ASR", > Publisher="oxf", > Year="2010", > Add="UK", > Edition="1", > } (snip) You might try writing bibtex macros that would parse them, then write them out in an easier to parse by you form. If you are only doing it once, you don't need the full syntax that bibtex allows, but only what yours use. That might allow for a simpler parser. I presume, for example, that TeX macros could be used in the bibtex file, which you would otherwise have to parse. -- glen