Re: Java2Python -- building/testing/using for the Pyjamas project

23 views
Skip to first unread message

Thomas Kalka

unread,
Jun 15, 2010, 5:15:41 PM6/15/10
to pyjamas-dev, java2python-discuss
I will crosspost this, until there is some feedback on going to
python2java-discuss for this topic.

On Tue, Jun 15, 2010 at 10:33 PM, C Anthony Risinger <ant...@extof.me> wrote:
> On Tue, Jun 15, 2010 at 3:09 PM, Thomas Kalka
> <thomas...@googlemail.com> wrote:
>> On Tue, Jun 15, 2010 at 8:23 PM, C Anthony Risinger <ant...@extof.me> wrote:
>>> i came across your work, and it seems to be exactly the efforts we are
>>> duplicating.  however, i am having trouble getting SVN trunk working
>>> properly to try it out.  is the project using antler3?  when i try to
>>> "make" inside the lib/ folder, i'm getting this error (after changing
>>> the command to antlr3 in the Makefile):
>>
>> I looked not so deep into this, since antlr 2.7 does not support
>> current java grammar.
>> I wrote a similar mail to the java2python mailinglist, which I will
>> forward to this list.
>
> ah, i see.  he seems he done some work to migrate to antlr3, and has a
> branch for it.  does antlr3 support the latest java language features?
>  what's the latest java needed anyway?  java?  i'm java-illiterate.
>
> at any rate, it might be more productive to build on top of an
> existing/working implementation.  he seems to have a stake in the
> tool, and a successful example of an entirely converted project:
>
> http://code.google.com/p/ibpy/
>
> mmmm.....  just some thoughts.  i don't care really,
> this/stratego/rodent-powered robots, whatever gets the job done with
> least duplication of effort.

The hardest part, imho, is the parser.
Thats why I was looking for some project, which does java parsing in
an "open" way.
Parser requirements:
- actual java grammar
-parsing of comments

Stratego was the best fit for that.
Its build as a queue of transformations.
First ist parsing, last ist deparsing, transformations in between.
The parser is able to parse comments and annotate the parsing tree
with positions inside original source.

In java-front there exist a nice deparsing framework for java, which I
tried to hack to produce python output.
This went very fine, so I startet to write a parser/generator for the
Aterm format, which is used to pipe one
transformation to the next.

--toka

Reply all
Reply to author
Forward
0 new messages