G
Guest
I'm trying to parse a CSharp code to a CodeCompileUnit with a ICodeParser interface of CSharpCodeProvide
But it seems to me, i can't get a ICodeParser interface
Looks like ICodeParser is not implemented in Framework
here is the code i'm using
//
StringBuilder sb = new StringBuilder()
TextWriter w = new StringWriter(sb)
CSharpCodeProvider csharp = new CSharpCodeProvider()
ICodeParser parser = csharp.CreateParser()
ICodeGenerator gen = csharp.CreateGenerator()
string sourceString = textBox1.Text
TextReader reader = new StringReader(sourceString)
CodeCompileUnit codeUnit = parser.Parse(reader)
// of course, this works fine
// CodeCompileUnit codeUnit = new CodeSnippetCompileUnit(textBox1.Text)
CodeGeneratorOptions o = new CodeGeneratorOptions()
gen.GenerateCodeFromCompileUnit
codeUnit
w
o)
textBox2.Text = sb.ToString()
//
But it seems to me, i can't get a ICodeParser interface
Looks like ICodeParser is not implemented in Framework
here is the code i'm using
//
StringBuilder sb = new StringBuilder()
TextWriter w = new StringWriter(sb)
CSharpCodeProvider csharp = new CSharpCodeProvider()
ICodeParser parser = csharp.CreateParser()
ICodeGenerator gen = csharp.CreateGenerator()
string sourceString = textBox1.Text
TextReader reader = new StringReader(sourceString)
CodeCompileUnit codeUnit = parser.Parse(reader)
// of course, this works fine
// CodeCompileUnit codeUnit = new CodeSnippetCompileUnit(textBox1.Text)
CodeGeneratorOptions o = new CodeGeneratorOptions()
gen.GenerateCodeFromCompileUnit
codeUnit
w
o)
textBox2.Text = sb.ToString()
//