Related articles |
---|
ok parser done what now sebastian@musicgigs.de (Sebastian Kielmann) (2003-05-06) |
Re: ok parser done what now dlindauer@notifier-is.net (david lindauer) (2003-05-12) |
From: | david lindauer <dlindauer@notifier-is.net> |
Newsgroups: | comp.compilers |
Date: | 12 May 2003 01:42:16 -0400 |
Organization: | Compilers Central |
References: | 03-05-012 |
Keywords: | parse, practice |
Posted-Date: | 12 May 2003 01:42:15 EDT |
Sebastian Kielmann wrote:
> I Just Finished The Parser For My Compiler, But I Want Him To Generate
> Machine Readable Code Like .Exe (Win). Where Should I Start On Looking For
> Info To Get This Done?
It depends on what you want to do. Do you want to do optimizations (you should
at least do constant folding and peephole opts)? In my own compiler I make an
internal linked list with all the assembly language instructions, and generate
them in pretty straightforward fashion from the data from the parser. Then I
have an output module that turns the internal representation into an assembly
language file... from there it is possible to use freely available assemblers
and linkers to generate a win32 EXE file. But there are all sorts of things
that can be done in addition to this to optimize the generated code, optimize
register usage, and so forth. IT really depends on how far you want to take
it.
David
Return to the
comp.compilers page.
Search the
comp.compilers archives again.