Exemplo n.º 1
0
        public static void Translate(
            CodeTextStorage storage,
            DispatchArgs dispatchArgs,
            string assemblyPath)
        {
            System.Console.WriteLine("AOTCompiler: Preparing assembly: \"{0}\" ...", Path.GetFullPath(assemblyPath));

            var metaContext                = new MetadataContext(assemblyPath, dispatchArgs.readSymbols);
            var translateContext           = new TranslateContext(assemblyPath, dispatchArgs.readSymbols, metaContext);
            CXXTranslateOptions cxxOptions = new CXXTranslateOptions();

            cxxOptions.StaticAssertOnUnimplementatedILs = dispatchArgs.cxxStaticAssertOnUnimplementatedILs;
            var cxxTranslator = new CXXTranslator(translateContext, cxxOptions);

            //using (var _ = storage.EnterScope("meta"))
            //{
            //    MetadataSerializer metaSerializer = new MetadataSerializer(translateContext);
            //    metaSerializer.WriteResult(storage);
            //}

            using (var _ = storage.EnterScope("include"))
            {
                cxxTranslator.WriteHeader(storage);
            }
            using (var _ = storage.EnterScope("src"))
            {
                cxxTranslator.WriteSource(storage);
            }

            System.Console.WriteLine(" done.");
        }
Exemplo n.º 2
0
 public static void TranslateAll(
     CodeTextStorage storage,
     DispatchArgs dispatchArgs,
     params string[] assemblyPaths)
 {
     TranslateAll(
         storage,
         dispatchArgs,
         (IEnumerable <string>)assemblyPaths);
 }
Exemplo n.º 3
0
        public static int Main(string[] args)
        {
            try
            {
                DispatchArgs dispatchArgs = new DispatchArgs();
                var          help         = false;

                var options = new OptionSet()
                {
                    { "g1|debug", "Emit debug informations (contains only comments)", v => dispatchArgs.debugInformationOptions = DebugInformationOptions.CommentOnly },
                    { "g|g2|debug-full", "Emit debug informations (contains line numbers)", v => dispatchArgs.debugInformationOptions = DebugInformationOptions.Full },
Exemplo n.º 4
0
 public static void TranslateAll(
     TextWriter logw,
     string outputPath,
     DispatchArgs dispatchArgs,
     params string[] assemblyPaths)
 {
     TranslateAll(
         logw,
         outputPath,
         dispatchArgs,
         (IEnumerable <string>)assemblyPaths);
 }
Exemplo n.º 5
0
 public static void TranslateAll(
     CodeTextStorage storage,
     DispatchArgs dispatchArgs,
     IEnumerable <string> assemblyPaths)
 {
     foreach (var aseemblyPath in assemblyPaths)
     {
         Translate(
             storage,
             dispatchArgs,
             aseemblyPath);
     }
 }
Exemplo n.º 6
0
        public static void TranslateAll(
            TextWriter logw,
            string outputPath,
            DispatchArgs dispatchArgs,
            IEnumerable <string> assemblyPaths)
        {
            Parallel.ForEach(assemblyPaths, aseemblyPath => {
                var storage = new CodeTextStorage(
                    logw,
                    outputPath,
                    "    ");

                Translate(
                    storage,
                    dispatchArgs,
                    aseemblyPath);
            });
        }
Exemplo n.º 7
0
        public static void TranslateAll(
            TextWriter logw,
            string outputPath,
            DispatchArgs dispatchArgs,
            IEnumerable <string> assemblyPaths)
        {
            var storage = new CodeTextStorage(
                logw,
                outputPath,
                "    ");

            foreach (var aseemblyPath in assemblyPaths)
            {
                Translate(
                    storage,
                    dispatchArgs,
                    aseemblyPath);
            }
        }