I decided to take a temporary detour into perl 5, since named captures are not yet in pugs. I've finished the grammar and produced an Abstract Syntax Tree for javap output. The only thing I still want is to actually load the java classes so I can pull constant values from them. Other than that, the grammar is complete in Perl 5.
Now I must study Perl 6 role declarations so I can generate the ones that correspond to my ASTs.
I also need to give some thought to formal testing. So far, I've been manually checking the output for a couple of key class/interfaces. But, I don't trust them to be stable. So, I will have to write some reliable java myself. Then, I'll know that it won't change with Java updates.
Phil
Since you had to detour into Perl 5 anyway, maybe you might stop by Moose and try out our Roles. They should match the basic role composition rules which Perl 6 will follow, minus some fancier features like parameterization. If nothing more, Perl 5 classes tend to be easier to generate programatically using Moose and Class::MOP then doing all that symbol table hackery yourself.
- Stevan
Re:Moose Roles
Tim Bunce on 2007-05-13T15:19:26
While perl5 may be used for the code generation, it's a key goal of the current grant-funded java2perl work that the output be valid perl6.
It would certainly be good for it to be able to support generating perl5 code in the future - and Moose would make sense in that context - but it's not part of the current work.