[Mono-list] Status of Bison port to C#

Stephen Torri storri@sbcglobal.net
23 Feb 2002 00:09:59 -0500

On Fri, 2002-02-22 at 23:56, Nick Drochak wrote:
> Should be pretty straight forward to port the whole thing since Java and
> C# are so similar.  That was a longer term goal of mine for jb2csharp.  

I first need to get my hands on the language specification for C#. I
will need to read that first before I begin.
> In particular there's one part where JB takes the "goto" statements from
> bison and makes some convoluted hacks to make it work in Java, since
> there really is no "goto" statement (as I understand it, my Java's not
> so strong).  C# has a goto statement like C/C++, so I'd like to see that
> part re-written for sure.

Goto I thought was only a Basic programming keyword. I have not seen it
used in C/C++/Java. This repeats the necessity to read the language

> The goal definitely needs to be "add C# support, but keep Java support
> as well".  In the end I imagine some sort of command line switch to
> select which language you want it to generate with, just like lex does
> with C/C++.

If we are making this to be the C# compiler for mono I don't think its
in our best interest to play with Java. Java has an already good
compiler from IBM called Jikes. Jikes is fast. No sense in re-inventing
the wheel.

> The last thing I ran into when I was working on it was this: Parsing the
> "." separated items and finding a "(" or not was not so easy the way it
> was written.  I don't remember exactly the problem, but if you play
> around with a grammar and actions beyond the calc compiler, I'm sure
> you'll run into it and you'll know what I'm talking about.

Your are right. The grammar is the place I need to start. Fortunately I
am taking a compilers course as a part of my Masters program. The steps
as I see it is to learn the grammar. After which I figure how to put
into C#. I have experience with doing actions with Java CUP parser. 

> I say, go for it if your interested.  I'll be happy to help out if your
> eager to work on it.  Should I add you to the SourceForge project?  If
> so, let me know your SF.net username.

I need to talk with Ravi and Miguel about how to do this part with the
present compiler. I would like to write this parser in C# so that it can
bootstrap with the rest of the compiler. This is my thoughts so far.