Related articles |
---|
Newbie Q - Grammer rules for parsing HEX string in BISON spacemonkeyxyz-google@yahoo.co.uk (2004-08-23) |
Re: Newbie Q - Grammer rules for parsing HEX string in BISON spacemonkeyxyz-google@yahoo.co.uk (2004-08-25) |
Re: Newbie Q - Grammer rules for parsing HEX string in BISON vbdis@aol.com (2004-09-03) |
From: | vbdis@aol.com (VBDis) |
Newsgroups: | comp.compilers |
Date: | 3 Sep 2004 12:38:37 -0400 |
Organization: | AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com |
References: | 04-08-141 |
Keywords: | parse |
Posted-Date: | 03 Sep 2004 12:38:37 EDT |
spacemonkeyxyz-google@yahoo.co.uk (Space Monkey) schreibt:
>I should have added that the desired outcome is to populate the
>contents of a binary file using instructions contained in a separate
>text file.
In that simple case I'd handcraft the appropriate code.
>I am a complete novice on YACC and BISON and any help with the grammar
>rules for the parsing the hexadecimal list in the above example is
>appreciated.
If you want to learn more about YACC and BISON, then have a look at a C like
grammar (you'll not need a full C/C++ grammar). The semantic code may be
simple, depending on the "commands" in your text file. For your example you can
use a global variable for the memory address, where every parsed number is to
be stored, and afterwards the address has to be incremented (*addr++ = nmbr;).
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.