Exemplo n.º 1
0
        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'));
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
		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();
		}
Exemplo n.º 4
0
		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');
		}
Exemplo n.º 5
0
 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);
 }