|Question about writing assemblers email@example.com (Maliha Samad) (2000-02-15)|
|Re: Question about writing assemblers firstname.lastname@example.org (David Lindauer) (2000-02-15)|
|Re: Question about writing assemblers email@example.com (Sean Case) (2000-02-16)|
|Re: Question about writing assemblers firstname.lastname@example.org (Ian Lance Taylor) (2000-02-16)|
|Re: Question about writing assemblers email@example.com (2000-02-19)|
|From:||Ian Lance Taylor <firstname.lastname@example.org>|
|Date:||16 Feb 2000 23:41:20 -0500|
In comp.compilers email@example.com (Maliha Samad) writes:
>I am very confused as to whether I should write a hand coded assembler
>or should I use the existing tools like lex and yacc.
I've been working on the GNU assembler for several years.
I've never felt a need to use lex. Most assemblers accept a simple
line oriented syntax, and it is normally easy to pick out operands.
Only once have I seen a reason to use yacc. That was for the m68k
operand syntax. The m68k has a wide range of operand types, and for
historical reasons the GNU assembler supports two different operand
syntaxes. The original code to recognize both syntaxes was complex;
changing to yacc (work which I didn't start) made it quite a bit
clearer. Even then, the yacc parser was applied only to the operands;
picking out the operands themselves was done by a simpler procedure.
Of course what you should do depends upon the syntax you have to
Ian Taylor | firstname.lastname@example.org
Return to the
Search the comp.compilers archives again.