Пример #1
0
        private IExpression resolveType(Context context)
        {
            IDeclaration decl = context.getRegisteredDeclaration <IDeclaration>(name);

            if (decl is EnumeratedCategoryDeclaration)
            {
                return(new TypeExpression(new EnumeratedCategoryType(name)));
            }
            else if (decl is CategoryDeclaration)
            {
                return(new TypeExpression(new CategoryType(name)));
            }
            else if (decl is EnumeratedNativeDeclaration)
            {
                return(new TypeExpression(decl.GetIType(context)));
            }
            else
            {
                foreach (IType type in NativeType.getAll())
                {
                    if (name == type.GetTypeName())
                    {
                        return(new TypeExpression(type));
                    }
                }
            }
            return(null);
        }