예제 #1
0
        CGFFieldSymbol(Microsoft.CodeAnalysis.IFieldSymbol fieldSymbol)
        {
            m_FieldSymbol = fieldSymbol;

            Microsoft.CodeAnalysis.ITypeSymbol typeSymbol = m_FieldSymbol.Type;
            if (typeSymbol.TypeKind == Microsoft.CodeAnalysis.TypeKind.Array)
            {
                Microsoft.CodeAnalysis.IArrayTypeSymbol arrayTypeSymbol = fieldSymbol.Type as Microsoft.CodeAnalysis.IArrayTypeSymbol;
                TypeName = arrayTypeSymbol.ElementType.Name + "[]";
                UnderlyingSpecialType = arrayTypeSymbol.ElementType.SpecialType;
                IsSystemType          = arrayTypeSymbol.ElementType.SpecialType != Microsoft.CodeAnalysis.SpecialType.None;
            }
            else
            {
                TypeName = typeSymbol.Name;
                UnderlyingSpecialType = typeSymbol.SpecialType;
                IsSystemType          = typeSymbol.SpecialType != Microsoft.CodeAnalysis.SpecialType.None;
            }
        }
예제 #2
0
        public static Expression CreateGenerated(Context cx, IExpressionParentEntity parent, int childIndex, Microsoft.CodeAnalysis.ITypeSymbol type, Extraction.Entities.Location location)
        {
            var typeAccessInfo = new ExpressionInfo(
                cx,
                AnnotatedTypeSymbol.CreateNotAnnotated(type),
                location,
                ExprKind.TYPE_ACCESS,
                parent,
                childIndex,
                true,
                null);

            return(new Expression(typeAccessInfo));
        }
예제 #3
0
        public static Expression CreateGenerated(Context cx, IExpressionParentEntity parent, int childIndex, Microsoft.CodeAnalysis.ITypeSymbol type, object?value, Action <Expression, int> createChild, Extraction.Entities.Location location)
        {
            var info = new ExpressionInfo(
                cx,
                AnnotatedTypeSymbol.CreateNotAnnotated(type),
                location,
                ExprKind.CAST,
                parent,
                childIndex,
                true,
                ValueAsString(value));

            var ret = new Expression(info);

            createChild(ret, ExpressionIndex);

            TypeAccess.CreateGenerated(cx, ret, TypeAccessIndex, type, location);

            return(ret);
        }