GAS parser

Ian Lance Taylor iant@google.com
Thu Aug 2 17:52:00 GMT 2007


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



More information about the Binutils mailing list