On Tue, 5 Aug 2003, Dan Sugalski wrote: > The original thought was to use the new perl 6 grammar engine/code > to do this, but I think it'll be a while before that's ready to go.
I think perl6 is definitely the way to go, once it's ready. BTW, what's the deal with Bundle::Perl6? I tried installing it from cpan yesterday but it wouldn't install with my perl. (I forget why) Is it meant to be usable today? > Rather than invent an entirely new language for this (which is > somewhat problematic) why not go for something already reasonably > well-known? YACC and BNF grammars seem like a good place to start, > especially as most of the languages have some form of grammar > defined for them. Well the "new language" was just for the imcc code templates. Now I think the better path is to define a code-generating class for each ast node. Then PythonWhileNode can be a subclass of the generic WhileNode. (Python while statements have an extra "else" block that most languages don't have) > It's only a first step, as then everyone beats the heck out of the > resulting token stream, but it's a place to start. 80-90% of the > result will end up being generically parseable as well--"x + y" will > generate the same code for all languages if x and y are PMCs, for > example, so I'd bet we could have a lot of standard products > designed. Yep. For now, everything pypirate generates *is* pmc based, since python doesn't have type declarations. Generic pirate should probably have a "declare" node though. (Especially if it's to handle perl6, right?) Sincerely, Michal J Wallace Sabren Enterprises, Inc. ------------------------------------- contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.com/ --------------------------------------