protected void BuildField(ClassType classType, FieldInfo fieldInfo)
        {
            var fieldType = storage.GetType(ConvertMSILNames(fieldInfo.FieldType));

            if (fieldType != null)
            {
                classType.AddField(fieldInfo.Name, fieldType);
            }
        }
Example #2
0
        private void Visit(ClassDefNode node, CodegenContext context)
        {
            var type = types.GetType(node.Name) as ClassType;

            context.CurrentClass = type;

            var classBuilder = builder.BuildClass(type);

            foreach (var item in node.Defs)
            {
                Visit(item, classBuilder, context);
            }
        }
Example #3
0
        private void BuildType(System.Type type)
        {
            if (type.IsGenericType)
            {
                var genericTemplate = storage.GetTemplate(type.Name);

                genericLoader.Build(genericTemplate, type);
            }
            else
            {
                var typeInfo = storage.GetType(type.Name);

                if (type.IsAbstract)
                {
                    packageLoader.Build(typeInfo as PackageType, type);
                }
                else
                {
                    classLoader.Build(typeInfo as ClassType, type);
                }
            }
        }
Example #4
0
 private TypeInfo Visit(TypeNode node)
 {
     return(types.GetType(node.TypeName));
 }