Eclipse plugin

Ary Manzana ary at esperanto.org.ar
Tue Oct 31 18:34:50 PST 2006


Bruno Medeiros escribió:
> Ary Manzana wrote:
> Hi, yes, I'm working on an Eclipse plugin too. I've started very 
> recently (about two weeks ago), so I don't have anything significant to 
> show yet, but I'm doing this as my degree final project, so I will be 
> working on it during all school year.
> 
> We definitely should talk and see if we can combine efforts, but the 
> approach I was thinking was to build a parser using ANTLR, similar to 
> what the previous eclipse plugins did (Blackbird, DDT). However, you 
> seem to be far ahead of I've done. You say you've converted the whole D 
> frontend to Java? (to descent\internal\core\dom\Parser.java I presume) 
> That must have been a lot of work. I'd actually like to know how long it 
> took for you to do that

About a month and a half? (in my precious little spare time, of course 
:-P). I don't remember...

, and if it's working correctly. I'm gonna take a
> better look at your code.
> 
> 

Great! I would be very happy to combine efforts. The project now has a 
webpage in dsource.org:

http://www.dsource.org/projects/descent/

There I wrote an explanation about why not to use ANTLR (I started doing 
that, then I changed to using DMD source code and it was *way* faster 
and better).

I only converted parser.h, parser.c (yes, 
descent\internal\core\dom\Parser.java) , lexer.h, lexer.c 
(descent\internal\core\dom\Lexer.java) and the classes/functions 
referenced there: just the clean model with no semmantic stuff. Porting 
c++ to Java was not an easy task, especially since Java has no powerful 
"goto" (oh my, 732 in the whole code), so I had to change some of the 
code, or duplicate it (I don't want to break anything at first).

Is it working ok? Check descent.test.jar. You can find cases to test 
both the parser and the lexer. I just downloaded the excelent 
Coverclipse ( http://coverlipse.sourceforge.net/ ): the parser is %65 
tested; the lexer %68. That's more than half of it! :-)

And it's not just copy-paste and test. The Token class now has two 
properties to tell its start position and length, as well as every class 
in the model, since a regular compiler dosen't need it, but a visual 
does. And I've written nice interfaces to the model (check 
descent.core.dom).

The first step would be to get (close to) %100 test coverage on parser 
and lexer, then move on to the big (juicy) stuff.

Read the last sentence I wrote on the dsource page: wait for me until 
then :-)

(I will write all of these explanations in the webpage, and more, when 
I'll come back, I promise)



More information about the Digitalmars-d mailing list