Re: [Oopic-compiler-devel] Compiler design
Status: Planning
Brought to you by:
ndurant
From: Neil D. <nd...@us...> - 2004-05-12 02:01:49
|
My expertise is on the other end - I have written a number of parsers and code to generate internal representations from an input grammar. So it seems our expertise lies in three convenient areas: Andy: Code generation/optimisation Daniel: Reverse-engineering and op-code specialist Me: Parsing of the input language So perhaps we should work out the boundary between the "front end" part of the compiler, ie the language parsing stuff, and the code generation side. If we can come up with a design for the interface between those two modules, and a rough design for the data structures that the parser will generate to pass on for code generation, then we can make a start. Parsers for compilers generally populate a tree structure, where each node represents some semantic aspect of the code. For example one node might represent a "for" loop, and could have properties such as pointers into a symbol table for the counter variable, and links to other nodes representing the test and iteration expression. It would also have a child node representing the block of code to loop over. That child node would have other child nodes representing the code within the block, and so on. I guess we need to work out what structures will be required to generate the code. Off the top of my head, we would need at least: A tree structure for the program itself A symbol table for variables (with type information) I'm sure we'll need a lot more than this, but my brain is begging for sleep!! Andy, can you think what other structures we'll need to start code generation? Neil Andrew Porrett wrote: > Don't know very much about compiler design. Assumed we would do pretty > much what you outlined. I expect my expertise will come into play more > when we get around to code generation and optimization. > > At 01:45 AM 5/12/2004 +0100, Neil Durant wrote: > >Did either have you have any ideas on the overall design of the compiler? > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver > higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 > _______________________________________________ > Oopic-compiler-devel mailing list > Oop...@li... > https://lists.sourceforge.net/lists/listinfo/oopic-compiler-devel > -- Neil Durant <nd...@us...> |