예제 #1
0
파일: Utils.cs 프로젝트: dubik/csharprpp
        private static void WireAssembly(SymbolTable scope, Assembly assembly)
        {
            Type[] types = assembly.GetTypes();

            foreach (Type type in types)
            {
                string name = type.Name;
                if (type.Name.Contains("`"))
                {
                    name = name.Substring(0, name.IndexOf('`'));
                }

                RType rType = RppTypeSystem.GetOrCreateType(name, type);
                scope.AddType(rType);
            }
        }
예제 #2
0
 public void PreAnalyze(SymbolTable scope)
 {
     _classes.ForEach(c => scope.AddType(c.Type));
     NodeUtils.PreAnalyze(scope, _classes);
 }
예제 #3
0
파일: Utils.cs 프로젝트: dubik/csharprpp
        private static void WireRuntime(SymbolTable scope)
        {
            Assembly runtimeAssembly = GetRuntimeAssembly();
            WireAssembly(scope, runtimeAssembly);

            scope.AddType(RppTypeSystem.GetOrCreateType("Exception", typeof(Exception)));
        }
예제 #4
0
        private static void WireAssembly(SymbolTable scope, Assembly assembly)
        {
            Type[] types = assembly.GetTypes();

            foreach (Type type in types)
            {
                string name = type.Name;
                if (type.Name.Contains("`"))
                {
                    name = name.Substring(0, name.IndexOf('`'));
                }

                if (type.GetField("_instance", BindingFlags.Public | BindingFlags.Static) != null && !name.EndsWith("$"))
                {
                    name = name + "$";
                }

                RType rType = RppTypeSystem.GetOrCreateType(name, type);
                scope.AddType(rType);
            }
        }