Re: [Oopic-compiler-devel] Compiler design
Status: Planning
Brought to you by:
ndurant
From: D. D. M. <dd...@mc...> - 2004-05-12 01:19:02
|
A couple of quick thoughts. 1. lack of support for the three syntax styles Savage implemented is probably a non-starter (unless we have the IDE selecting between the OOpicMK compiler and this one). As it is now, the user must specify the syntax; we can require the same as a command line. Or possibly use a token in the sourcecode similar to what Parallax did with their new PBasic syntax and the firmware revisions, and let the preprocessor pick it out. 2. After those, the grammer for an (or many) arbitrary syntax could be defined. 3. In all cases, the compiler tools yield a similar internal representation that is subjected to code generation and optimization. For the original scripts' syntax, should we generate identical code to the OOpicMK or use our own? 4. Does the grammer specification require some (or deep) knowledge of the possible syntactical structures the native byte-codes would permit? If so, then I should get some more work done. Daniel ----- Original Message ----- From: "Neil Durant" <nd...@us...> To: "OOPic Compiler List" <oop...@li...> Sent: Tuesday, 11 May 2004 20:45 Subject: [Oopic-compiler-devel] Compiler design > Did either have you have any ideas on the overall design of the compiler? > I've been re-reading my book on Flex/Bison, and it would definitely be a > big time-saver using those tools. They would generate the C code for > parsing the grammar we provide (in a simple notation), and allow us to call > functions when the various semantic constructs are encountered. That way > we can build up a parse tree and populate symbol tables, and the > subsequently walk the tree generating code. We could then add an > optimisation stage that checks through the Forth-like codes to see if > anything silly is being done. > > This is the basic idea I have in mind, although I know there's a heck of a > lot of detail I've just hopped over! I'd be interested to hear how you > guys envisioned how the compiler would be structured. > > Thoughts? > > Neil > -- > Neil Durant > <nd...@us...> > > > ------------------------------------------------------- > 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 > |