Click here to Skip to main content
15,898,984 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
how to programatically create a compiler to build and run a .cs file give me solution.
Posted
Updated 16-Oct-12 21:02pm
v2
Comments
Sushil Mate 17-Oct-12 2:58am    
ROFL
Nelek 17-Oct-12 3:02am    
Maybe a little bit too ambitious?

StartButton -> CMD [ENTER]
csc /out:MyFile.exe mysoource.cs [ENTER]
MyFile [ENTER];


Unless you mean to write a compiler yourself, in which case you are going to need the help of a book on compiler writing - it is not a trivial task in any way at all.
 
Share this answer
 
Comments
MT_ 17-Oct-12 3:13am    
Nice one :-)
First, You should explain the question and intention little better for people to help you.
And two, Google/Yahoo/Bing are your pals.

I searched on Google "write a compiler in c#" in less than few seconds, it brought me following useful links !

http://blogs.microsoft.co.il/blogs/sasha/archive/2010/10/06/writing-a-compiler-in-c-lexical-analysis.aspx

write compiler in c#.net[^]

http://stackoverflow.com/questions/821086/resources-for-writing-a-c-sharp-compiler-for-class[^]

Also, check the kind of details poster has provided in the question in last link. That earned him/her lots of praise and answers.

Hope that helps. If it does, mark the answer as solution and/or upvote.

Thanks,
Milind
 
Share this answer
 
Let's suppose, you don't want to make your own c# compiler, and you are satisfied by using the one made by Microsoft - they made it available to anyone not only as command line tool, but also as library. Look here: Compiling code during runtime[^].
If you want to make compiler for an other platform, that's an other topic... but don't even try that...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900