Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

philcrow (3401)

philcrow
  (email not shown publicly)

Journal of philcrow (3401)

Monday April 30, 2007
05:45 PM

javap Perl 5 grammar

[ #33163 ]

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Since you had to detour into Perl 5 anyway, maybe you might stop by Moose [cpan.org] 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

    • 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.