Tuesday, May 09, 2006

May 9th, 2006 -- Grammar and module formed

It was really a long weekend and Monday. And a progressive Monday night and Tuesday. However, I forgot to write the blog entry last night. The numbered captures ($0, $1, ... ) are supported yesterday as well as escaped characters in string. But it didn't work until I commited the part of code dealing with character classes in Pugs::Emitter::Rule::Perl5 several minutes before. And the grammar now accept the array constructor "[1, 2, 3]".

clkao++ added the Makefile.PL and test suit making Pugs::Grammar::MiniPerl6 more like a module instead of the sank box of my own. I have to admit that I haven't written any perl module before and just studied the Makefile.PL in Pugs::Compiler::Rule.

The building process includes an invokation of compile_p6grammar.pl to translate the grammar file to the .pm file. I tried to use lrep instead but found character classes are not supported (just as what happened in Pugs::Compiler::Rule). But fglock++ stop me from switching to lrep and got offline right after that -- could you tell me why should I stay using compile_p6grammar.pl? :)

Currently all language constructions I planned to support in MiniPerl6 are implemented (except the "(a, b)" one but it's not necessary). I'll add more tests for it then move my concentration on Pugs::Compiler::Rule.

Updated: fglock++ left an IRC message to me "lrep is under a rewrite - compile_p6grammar.pl has less features, but it is more up-to-date". Ok, I'll use you script then :)


Post a Comment

Links to this post:

Create a Link

<< Home