begin quote from Rafael Garcia-Suarez: > Out of curiosity, what kind of parser do you intend to write ? A > Parse::RecDescent one ?
Parse::Yapp. > Have you an idea about what will be the 'final' > parser for the Perl 6 compiler ? (LALR(1), like Perl 5 ?) Yep, LALR1, probably yacc generated. > Side-note about whitespace. This is going to be tricky, because of the > DWIMery involved by the end-of-line on some constructs (do{}, IIRC). I know. This ought to be handled by '{' and '}', but it currently isn't. > IMHO, Perl6::Tokener->toke() should not return whitespace to the parser > (currently it returns (undef)x2, if I understand correctly), but should > trigger some internal state change on \n (or whatever a end-of-line may > be). So, it can insert a fake ';' token after "do { ... }\n" for the > parser. That's one way to do it, but I think it's probably easier to look ahead after '}'. -- A debugged program is one for which you have not yet found the conditions that make it fail. -- Jerry Ogdin