|
|
 | | From: | Juoke | | Subject: | Compiler Creator with IDE or similar. | | Date: | 30 Dec 2004 22:53:55 -0500 |
|
|
 | I need a tool to obtain a portable compiler (e.g. a standard c++ set of file could be good) that takes an input file and generates an output one with a bytecode description.
I know there are dozens of tools and so on... but I have complex grammars (not just one) and so I want to focus on my work of analysis and not on the task of building files here and there. A good solution would be an IDE where I can edit my language and have the compiler generated (like the good GOLD PARSER, but it doesn't generate anything - and you can't extend the definition with semantic actions).
Another good chance would be a free source with an external definition file, so I could modify it: A "simple compiler" in c++, but I mean a "compiler" not just a scanner, a parser or any other part of a FULL compiler.
Thank you.
|
|
 | | From: | Ira Baxter | | Subject: | Re: Compiler Creator with IDE or similar. | | Date: | 31 Dec 2004 13:04:34 -0500 |
|
|
 | "Juoke" wrote in message > I need a tool to obtain a portable compiler (e.g. a standard c++ set > of file could be good) that takes an input file and generates an > output one with a bytecode description. > > I know there are dozens of tools and so on... but I have complex > grammars (not just one) and so I want to focus on my work of analysis > and not on the task of building files here and there. A good solution > would be an IDE where I can edit my language and have the compiler > generated (like the good GOLD PARSER, but it doesn't generate anything > - and you can't extend the definition with semantic actions).
Complex grammars often means you need sophisticated parsing technology. But more imporantly, there's a lot of life beyond just parsing; a plain parsing engine only solves a smalll part of your problem. You also need to define how names are resolved (symbol tables) and what the types of operands (type inference) are.
You may want to do, in effect, source-level optimizations before you generate code. Then you need to generate code. Even with byte-code descriptions, you will probably want some special case (e.g., peephole) optimizations.
If you want to do this for multiple languages, you need a tool that can handle multiple langauges easily, and help you with all of the above tasks.
The DMS Software Reengineering Toolkit comes pretty close. It has specific support for all the tasks listed above except the final code generator; you'll have to code your own custom byte-code generators if you want binary output. If you are willing to settle for source code output of (e.g., psuedo assembler for your byte codes), then DMS has ways for you to encode the translation from the source code level to the object-code level. See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html.
|
|
|