예제 #1
0
        internal void AddClrModules(NamespaceTreeNode treeNode)
        {
            foreach (var ns in treeNode.GetNamespaces())
            {
                if (_constants == null)
                {
                    // not initialized yet:

                    if (_clrModule == null)
                    {
                        // promote the Ruby module to a CLR namespace:
                    }
                    else
                    {
                        // TODO:
                        // if namespace => merge
                        // if type => ???
                    }
                }
                else
                {
                    // already initialized:
                    // TODO: MergeInitialized();
                }
            }

            foreach (var typeDef in treeNode.GetTypeDefs())
            {
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: kerwon/dlr
        private static void DumpNamespaceTree(int level, NamespaceTreeNode node)
        {
            string indent = new String(' ', level * 2);

            _output.WriteLine("{0}{1}: {2}/{3}",
                              indent,
                              node.Name,
                              node.GetTypeDefs().Count(),
                              (from def in node.GetTypeDefs() where (def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public select def).Count()
                              );

            foreach (var typeDef in node.GetTypeDefs())
            {
                if ((typeDef.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public)
                {
                    _output.WriteLine("{0}  {1}", indent, typeDef.Name);
                }
            }

            foreach (var ns in node.GetNamespaces())
            {
                DumpNamespaceTree(level + 1, ns);
            }
        }
예제 #3
0
        internal override void InitializeConstants(RubyContext context, Dictionary <string, object> constants)
        {
            foreach (TypeDef typeDef in _namespaceNode.GetTypeDefs())
            {
                constants[typeDef.Name.ToString()] = new RubyModule(context, new ClrTypeInfo(typeDef));
            }

            foreach (var ns in _namespaceNode.GetNamespaces())
            {
                constants[ns.Name.ToString()] = new RubyModule(context, new ClrNamespaceInfo(ns));
            }

            // TODO: resolve namespace/type conflicts (C# doesn't allow, but there could be some)

            _namespaceNode = null;
        }
예제 #4
0
        internal void AddClrModules(NamespaceTreeNode treeNode)
        {
            foreach (var ns in treeNode.GetNamespaces()) {
                if (_constants == null) {
                    // not initialized yet:

                    if (_clrModule == null) {
                        // promote the Ruby module to a CLR namespace:

                    } else {
                        // TODO:
                        // if namespace => merge
                        // if type => ???
                    }
                } else {
                    // already initialized:
                    // TODO: MergeInitialized();
                }
            }

            foreach (var typeDef in treeNode.GetTypeDefs()) {

            }
        }
예제 #5
0
파일: Program.cs 프로젝트: TerabyteX/main
        private static void DumpNamespaceTree(int level, NamespaceTreeNode node)
        {
            string indent = new String(' ', level * 2);
            _output.WriteLine("{0}{1}: {2}/{3}",
                indent,
                node.Name,
                node.GetTypeDefs().Count(),
                (from def in node.GetTypeDefs() where (def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public select def).Count()
            );

            foreach (var typeDef in node.GetTypeDefs()) {
                if ((typeDef.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public) {
                    _output.WriteLine("{0}  {1}", indent, typeDef.Name);
                }
            }

            foreach (var ns in node.GetNamespaces()) {
                DumpNamespaceTree(level + 1, ns);
            }
        }