I found a tool on Microsoft's site that does some of the conversion and was
what I started from.  At the very least, it copied all of the .java files to
.cs files.  Here is a link to what I downloaded:

http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?ur
l=/msdn-files/027/001/867/msdncompositedoc.xml

It does not do a complete conversion by any means (and really screwed up the
ParserTokenManager), but enough to get a start.  I just took some time in
the beginning to see what I really had to have - I started with the java
source and paired it down to not have anything that was not needed to just
support the app_example1 scenario.  And then I started the port from that.
Fortunately, there are many similarities between Java and C# (which has also
gotten me in trouble).

I had a hard time with the parser classes, I quess because I don't do many
bitwise operations and that was full of them and the code was less
straightforward.  At that point, I had to write a simple JUnit test and an
equal NUnit test and run both line for line to see where things were
different (and I think I found a bug in the VS IDE/debugger dealing with
octal evaluations - i.e. the 077 that is all over the place).  Now that I
have done it, and am much more familiar with the code, I think I could do it
again much faster the next time (and heaven help me if there is...).  The
conversion did not deal well with the introspection classes with, but I was
able to see what you were trying to do and wrote some tests that showed I
was getting back what it appeared that was needed and made those work.

The rest was trying to compile small parts at a time and converting small
parts at a time.  The project has a lot of cross dependencies, so I would
comment out what I hadn't ported yet and just started building the outer
most parts that I could in isolation.  Just do that for 4 or 5 hours a day
for 2 weeks....and voila!

I can see that trying to keep the 2 projects compatible would be possible,
but could be very time consuming.  I was just thinking how I would, assuming
I was done, incorporate any new 1.3 final code into the C# version - I guess
I would have to do a diff between the 1.3-r1 code that I started from and
the final and work from that.  If you are regenerating the Parser code every
time, that might be difficult.  I think you were right in the original
response, that the parser might be the hardest part.
 
How many people are currently, actively participating in the development?  I
didn't notice anywhere that mentioned what the 1.4 feature set was to be, is
that somewhere that can be seen?

Cort

P.S.  I haven't started a project anywhere yet (like SourceForge), so let me
know if you are interested in the code.  BTW, if I did, I wouldn't be able
to call it Velocity, is that correct?  If not, any ideas?

Reply via email to