|
From: | Hans Aberg |
Subject: | Re: How to make a meta assembler with bison? |
Date: | Wed, 15 Apr 2009 09:43:04 +0200 |
On 13 Apr 2009, at 16:39, narmo wrote:
Hi!! I need to make something like a meta assembler in bison.
You might ask in the Usenet newsgroup comp.compilers what tools are normally used when writing microassemblers.
In other wordsI need users can add instructions (tokens) to original program. Is thispossible in bison???
Bison just generates a parser, which processes a stream of tokens it is fed from the lexer. For that latter, Flex is often used. If one wants be able to definitions for say identifiers, then one has a look- up table where definitions are stored. When the lexer finds an identifier, it checks what information is stored about it, including what type of token it is, and hands that over to the parser.
Hans
[Prev in Thread] | Current Thread | [Next in Thread] |