This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GAS parser
- From: Ian Lance Taylor <iant at google dot com>
- To: Ivan Pryanishnikov <prianich at complang dot tuwien dot ac dot at>
- Cc: binutils at sourceware dot org
- Date: 02 Aug 2007 10:50:56 -0700
- Subject: Re: GAS parser
- References: <20070802135244.GA23349@complang.tuwien.ac.at>
Ivan Pryanishnikov <prianich@complang.tuwien.ac.at> writes:
> I have a question concerning GAS: some ports (eg, bfin) use
> lex/bison extensions (eg, bfin-lex.l, bfin-parse.y) to write their
> parsers.
>
> I was wandering about the reasons behind; possibly some of them
> are:
> - it's easier (generally) in some sense
> - it's not possible to solve their parsing problems in a standard way
> - they had some non-gnu assembler and just adjust/reuse it for the
> binutils assembler (because it's easier than to write from scratch)
> - ??
I don't know about bfin. For m68k Ken and I wrote a Bison parser
(though not a flex lexer) because the assembler needed to support two
different syntaxes, and the cases were sufficiently complex that it
seemed worthwhile to express them in a grammar, to minimize the chance
of error. So I guess that your option 1 applies for the m68k.
Ian