Re: [Oopic-compiler-devel] Compiler design
Status: Planning
Brought to you by:
ndurant
From: Andrew P. <wa...@ic...> - 2004-05-12 14:21:27
|
At 09:13 PM 5/11/2004 -0400, D. Daniel McGlothin wrote: >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. Using the existing compiler's command line flags makes sense (makes ours a drop in replacement). Nothing wrong with supporting a token in the source code as well (it would override the command line). As I think about it, I like the idea of simply writing a trivial prescanner that determines what language the user picked. If you find "sub void", it ain't real C, etc. Lots of semicolons means it's not BASIC, etc. > >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? The currently generated code is pretty bad. I'm sure we can do better. > >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. The native bytecodes will tell us what we can and can't do. I see the bytecode map as step #1. ...Andy |