Esempio n. 1
0
        /// <summary>
        /// Gets the string representing this type instance in generated code.
        /// </summary>
        /// <param name="truncateNamespace">If set to <c>true</c> namespace won't be added to the generated type string.</param>
        /// <returns>The string representing this type instance in generated code.</returns>
        public override string GetTypeString(bool truncateNamespace = false)
        {
            string elementTypeString = ElementType.GetTypeString(truncateNamespace);

            if (IsPhysical)
            {
                return($"{elementTypeString}[]");
            }
            return($"{CodeNaming.ToString(typeof(CodeArray))}<{elementTypeString}>");
        }
Esempio n. 2
0
        /// <summary>
        /// Function that should evaluate <see cref="UserType.TypeName"/> property.
        /// </summary>
        /// <returns>User type name.</returns>
        protected override string GetTypeName()
        {
            if (Symbol is EnumConstantSymbol enumConstant)
            {
                return(CodeNaming.FixUserNaming($"{enumConstant.EnumSymbol.UserType.FullTypeName}_{enumConstant.Value}"));
            }

            if (Symbol is IntegralConstantSymbol integralConstant)
            {
                return(CodeNaming.FixUserNaming($"{CodeNaming.ToString(integralConstant.Value.GetType())}_{integralConstant.Value}"));
            }

            throw new System.NotImplementedException();
        }
Esempio n. 3
0
 /// <summary>
 /// Gets the string representing this type instance in generated code.
 /// </summary>
 /// <param name="truncateNamespace">If set to <c>true</c> namespace won't be added to the generated type string.</param>
 /// <returns>The string representing this type instance in generated code.</returns>
 public override string GetTypeString(bool truncateNamespace = false)
 {
     return(CodeNaming.ToString(typeof(CodeFunction)));
 }
Esempio n. 4
0
 /// <summary>
 /// Gets the string representing this type instance in generated code.
 /// </summary>
 /// <param name="truncateNamespace">If set to <c>true</c> namespace won't be added to the generated type string.</param>
 /// <returns>The string representing this type instance in generated code.</returns>
 public override string GetTypeString(bool truncateNamespace = false)
 {
     return(IsVariable ? CodeNaming.ToString(typeof(Variable)) : CodeNaming.ToString(typeof(UserType)));
 }
Esempio n. 5
0
 /// <summary>
 /// Gets the string representing this type instance in generated code.
 /// </summary>
 /// <param name="truncateNamespace">If set to <c>true</c> namespace won't be added to the generated type string.</param>
 /// <returns>The string representing this type instance in generated code.</returns>
 public override string GetTypeString(bool truncateNamespace = false)
 {
     return(CodeNaming.ToString(BasicType));
 }
        /// <summary>
        /// Gets the string representing this type instance in generated code.
        /// </summary>
        /// <param name="truncateNamespace">If set to <c>true</c> namespace won't be added to the generated type string.</param>
        /// <returns>The string representing this type instance in generated code.</returns>
        public override string GetTypeString(bool truncateNamespace = false)
        {
            string elementTypeString = ElementType.GetTypeString(truncateNamespace);

            return($"{CodeNaming.ToString(typeof(CodePointer))}<{elementTypeString}>");
        }