On Fri, Sep 17, 2004 at 11:44:09AM +0200, James Mastros wrote: > Patrick R. Michaud wrote: > >On Tue, Sep 14, 2004 at 12:42:59PM -0700, Larry Wall wrote: > >>I agree that the default should be the current outer language. > >>I agree that the default ought to be overridable. > >>I agree that the right way to do that is with something like "use PIR;" > >>rather than inventing an inconsistent syntax. > /me starts to make an observation that making it look like perl6 when > it's not is paramount to lying to our users, but decides to invoke rule > 1 in his mind.
Er, that's not what Larry said. The "outer" language is Perl and *it* specifies what to expect in the "inner" language. Thus, in the Perl code there will be "use rx :deflang<<PIR>>" or "use PIR" or some such, not in the closure. > I'm assuming s/outer language/inner language/g in the following, as it > makes no sense otherwise... > >What should the mechanism be for the rule parser to figure out where > >a closure begins and ends within a rule expression? Does the rules > >parser have to call the outer language compiler directly? > > >If so, does this imply that the rules parser has to be running in > >Parrot to be able to call the outer language compiler, or is there a > >way to do this from C? > It has to either be within Parrot or embed Parrot, as most of the > language compilers are written in PIR. I don't know that this is necessarily true. The inner language just has to generate a "closure" in some manner that the rules parser can deal with. Unless that's what you mean by "embed Parrot". > >And does the outer language compiler have to have options that > >allow the caller to say: "hey, here's some program code with perhaps > >a bunch of rule-syntax stuff appended to it, could you just give me > >back the first complete 'closure unit' and oh, by the way, tell me how > >many characters you used to do it or give me the left-over string so > >I can continue parsing my stuff?" > Not presently, but there should be. (And there should be an extra, > optional, argument to the compile opcode to pass in options like this.) > > (The interface should probably be to consume the used portion of the S > register passed in.) It's a good thing Larry gave us <cut> then ;-) -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]