Exemple #1
0
        public void Convert(IEnumerable <SourceFile> inputs, IEnumerable <string> definedSymbols, IEnumerable <string> referencedAssemblies, Action <string, string, int> onScriptConverted)
        {
            var comments = CollectCommentsFrom(inputs, definedSymbols);
            var comp     = CreatAndInitializeCompiler(inputs, definedSymbols, referencedAssemblies, comments);
            var result   = comp.Run();

            HandleCompilationResult(result);

            var visitor = new UnityScript2CSharpConverterVisitor();

            visitor.ScriptConverted += onScriptConverted;
            result.CompileUnit.Accept(visitor);

            if (_checkOrphanComments)
            {
                result.CompileUnit.Accept(new OrphanCommentVisitor());
            }
        }
Exemple #2
0
 private SwitchConverter(Writer writer, UnityScript2CSharpConverterVisitor us2CsVisitor)
 {
     _writer       = writer;
     _us2CsVisitor = us2CsVisitor;
 }
Exemple #3
0
        public static bool Convert(Block node, Writer writer, UnityScript2CSharpConverterVisitor us2csVisitor)
        {
            var handler = new SwitchConverter(writer, us2csVisitor);

            return(handler.Convert(node));
        }