public string ConvertVariable(IVariable v) { TypeSystemAstBuilder astBuilder = CreateAstBuilder(); AstNode astNode = astBuilder.ConvertVariable(v); CppFormattingOptions formatting = new CppFormattingOptions(); StringWriter writer = new StringWriter(); astNode.AcceptVisitor(new CppOutputVisitor(writer, formatting), null); return(writer.ToString().TrimEnd(';', '\r', '\n')); }
public string ConvertType(IType type) { TypeSystemAstBuilder astBuilder = CreateAstBuilder(); AstType astType = astBuilder.ConvertType(type); CppFormattingOptions formatting = new CppFormattingOptions(); StringWriter writer = new StringWriter(); astType.AcceptVisitor(new CppOutputVisitor(writer, formatting), null); return(writer.ToString()); }
public string ConvertType(IType type) { TypeSystemAstBuilder astBuilder = CreateAstBuilder(); AstType astType = astBuilder.ConvertType(type); CppFormattingOptions formatting = new CppFormattingOptions(); StringWriter writer = new StringWriter(); astType.AcceptVisitor(new CppOutputVisitor(writer, formatting), null); return writer.ToString(); }
public string ConvertVariable(IVariable v) { TypeSystemAstBuilder astBuilder = CreateAstBuilder(); AstNode astNode = astBuilder.ConvertVariable(v); CppFormattingOptions formatting = new CppFormattingOptions(); StringWriter writer = new StringWriter(); astNode.AcceptVisitor(new CppOutputVisitor(writer, formatting), null); return writer.ToString().TrimEnd(';', '\r', '\n'); }
void RunTransformsAndGenerateCode(AstBuilder astBuilder, ITextOutput output, DecompilationOptions options, ModuleDefinition module) { astBuilder.RunTransformations(transformAbortCondition); if (options.DecompilerSettings.ShowXmlDocumentation) AddXmlDocTransform.Run(astBuilder.CompilationUnit); var unit = astBuilder.CompilationUnit.AcceptVisitor(new CSharpToCppConverterVisitor(new ILSpyEnvironmentProvider()), null); var outputFormatter = new CppTextOutputFormatter(output); var formattingPolicy = new CppFormattingOptions(); unit.AcceptVisitor(new CppOutputVisitor(outputFormatter, formattingPolicy), null); }