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
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison