Note: this post still seems to get tons of hits, and I do get a lot of requests for the source as well. This project was merged into the xamlon project, and is now rotting on some backup disks somewhere : ). There is a new C# parser if that is what brought you here you can read about it here . Not planning to go to swf with it, but feel free... Also, there is NeoSwiff if you are looking for C# to swf, from all I have heard it is an awesome product. Back to the old post...

C# Compiler - Version 0.5

This version is now has no known parsing errors, but of course there may still be some. A number of corrections were made to the parse, and a few changes made to the C#Dom - the API docs have been updated and are included. The newest code does type attribution (including overload resolution), and includes line info (on the regenerated cs files, not the source). It does not yet resolve assemblies and their types, and that may be a while as it is a bit beyond the scope of what I'm making this for. It is not yet parsing multiple files, though that will be fairly trival to add... I have done a wee bit of swf generation with this, oh finally the fun part!

To use it, download the exe and run it, then Open (or drag into the tree view) a C# file. The various trees are displayed in the tabs. As you click on the tree nodes, the regenerated C# window (tab 4) will highlight the code that coresponds to the node. The numbers at the end of the tree names indicate the types/members that each node represents or resolves to. Methods and constructors have a main type, and then 'sub definitions' for each overload. To use it in your own project, you need to reference CSharp.dll and the included antlr.runtime.dll -- you can look in the CSharpUI code to get an idea how to load files in etc. The front end will certainly change drastically, but only for the better - I say that with confidence, as everything is upwards from the bottom.

Note: this is *not* an open source project, however you are free to use the compiler as you see fit, no licence or fee is required -- with one exception -- and that is in publicly released multimedia software. If you are wondering exactly where that boundry is, please feel free to ask. Basically it is fairly loose, I just don't want to end up competing directly with myself in that category, eventhough that would probably be an easy way to insure a win. This may change in the future, but a free version will always be available, at least including updated bug fixes etc (and I do appreciate hearing about bugs : ).

The next version(s) will handle multiple files, maybe validation against assemblies, some control flow type optimization, and a new emitter friendly type of structure.

Downloads

Source
Executable
Home Page

Cheers,
Robin

posted on Tuesday, June 01, 2004 2:34 AM
Feedback

Blog Stats

  • Posts - 121
  • Stories - 1
  • Comments - 1441
  • Trackbacks - 47

.Net Blogs

01101 Blogs

Flash Blogs

Graphics

People