help-bison
[Top][All Lists]
Advanced

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

Re: Parse multiple versions of a document format?


From: Hans Aberg
Subject: Re: Parse multiple versions of a document format?
Date: Thu, 8 Oct 2009 14:34:04 +0200

On 8 Oct 2009, at 09:55, Rui Maciel wrote:

I'm writing a parser for a document format which has a couple of version out. The document format basically consists of a header field, where the document format version is specified and whose format is the same across all format
versions, followed by multiple fields which differ between versions.

Having that case in mind, what is the best strategy to write a bison parser
that is capable of parsing multiple versions of a document format?

It really depends how close the languages are. Think of a shell which handles different compilers for different languages. It would not be practical to build it together to one program. One the other hand, each compiler has set of option, which might compile a slightly different language. So it depends.

One possibility might be to let the header format select which compiler he rest should be sent to. If the languages then turn out to be close, they might be unified into one compiler with options; the header selects the options.

You might also try the Usenet newsgroup comp.compilers, giving more info about your format.

  Hans






reply via email to

[Prev in Thread] Current Thread [Next in Thread]