Exemplo n.º 1
0
            private void Check(LuaSyntaxGenerator generator)
            {
                foreach (var type in classTypes_)
                {
                    generator_.AddTypeSymbol(type);
                    if (!type.IsStatic)
                    {
                        foreach (var baseInterface in type.AllInterfaces)
                        {
                            foreach (var interfaceMember in baseInterface.GetMembers())
                            {
                                var implementationMember = type.FindImplementationForInterfaceMember(interfaceMember);
                                var implementationType   = implementationMember.ContainingType;
                                if (implementationType != type)
                                {
                                    if (!implementationType.AllInterfaces.Contains(baseInterface))
                                    {
                                        generator.AddImplicitInterfaceImplementation(implementationMember, interfaceMember);
                                        generator.TryAddExtend(baseInterface, implementationType);
                                    }
                                }
                            }
                        }

                        if (IsExtendSelf(type))
                        {
                            generator.typesOfExtendSelf_.Add(type);
                        }
                    }
                }
            }
Exemplo n.º 2
0
 public PretreatmentChecker(LuaSyntaxGenerator generator)
 {
     generator_ = generator;
     foreach (SyntaxTree syntaxTree in generator.compilation_.SyntaxTrees)
     {
         Visit(syntaxTree.GetRoot());
     }
     Check(generator);
 }
Exemplo n.º 3
0
        private void Compiler()
        {
            var commandLineArguments = CSharpCommandLineParser.Default.Parse(cscArguments_, null, null);
            var parseOptions         = commandLineArguments.ParseOptions.WithDocumentationMode(DocumentationMode.Parse);
            var files       = Directory.EnumerateFiles(folder_, "*.cs", SearchOption.AllDirectories);
            var syntaxTrees = files.Select(file => CSharpSyntaxTree.ParseText(File.ReadAllText(file), parseOptions, file));
            var references  = Libs.Select(i => MetadataReference.CreateFromFile(i));

            LuaSyntaxGenerator.SettingInfo setting = new LuaSyntaxGenerator.SettingInfo()
            {
                IsNewest     = isNewest_,
                HasSemicolon = hasSemicolon_,
                Indent       = indent_,
            };
            LuaSyntaxGenerator generator = new LuaSyntaxGenerator(syntaxTrees, references, commandLineArguments.CompilationOptions, Metas, setting, attributes_, folder_);

            generator.Generate(output_);
        }
Exemplo n.º 4
0
 public LuaRenderer(LuaSyntaxGenerator generator, TextWriter writer)
 {
     generator_ = generator;
     writer_    = writer;
 }
Exemplo n.º 5
0
 public LuaReflectionGenerator(LuaSyntaxGenerator luaSyntaxGenerator)
 {
     luaSyntaxGenerator_ = luaSyntaxGenerator;
 }
Exemplo n.º 6
0
 public LuaRenderer(LuaSyntaxGenerator generator, TextWriter writer)
 {
     // generator_ = generator;
     settings_ = generator.Setting;
     writer_   = writer;
 }