[antlr-interest] C# vs MSIL Output

Mike Bresnahan mbresnah at visi.com
Sun Mar 7 16:28:08 PST 2004


> Actually you can generate IL once you have a CodeDom tree - there are
> classes in the Microsoft.CSharp namespace:
>
> CSharpCodeProvider.CreateCompiler
> CSharpCodeProvider.CreateGenerator
> CSharpCodeProvider.CreateParser

As far as I can tell, the ICompiler object created by
CSharpCodeProvider.CreateCompiler converts the CodeDom to C# and invokes
csc.exe.  I'm guessing CodeDom is not transformed directly to MSIL because
csc.exe uses a different data structure for storing the parsed source code.
Until this internal data structure and CodeDom are the same or someone
writes a new compiler, we will be stuck transforming CodeDom to source code
as an intermediate step.

What's interesting is that there is an option to create the compiled
assembly in-memory instead of in a temporary file.  I'm guessing this means
that csc.exe outputs the assembly to stdout or through some other IPC
mechanism, however "csc.exe -help" does not list such and option.

Mike Bresnahan



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list