/// <summary> /// Initializes a new instance of the <see cref="TypeReferenceExpression"/> class. /// </summary> /// <param name="type">The type.</param> public TypeReferenceExpression(TypeBase type) { Type = type; }
public static bool HasDimensions(TypeBase typeDeclaration) { return((typeDeclaration is ScalarType) || (typeDeclaration is VectorType) || (typeDeclaration is MatrixType)); }
/// <summary> /// Initializes a new instance of the <see cref="MethodDefinition"/> class. /// </summary> /// <param name="returntype">The returntype.</param> /// <param name="name">The name.</param> public MethodDefinition(TypeBase returntype, string name) : this() { ReturnType = returntype; Name = new Identifier(name); declaration = this; }
/// <summary> /// Determines whether the specified type is an integer. /// </summary> /// <param name="type">The type.</param> /// <returns> /// <c>true</c> if the specified type is an integer; otherwise, <c>false</c>. /// </returns> public static bool IsInteger(TypeBase type) { return(type == Int || type == UInt); }
/// <summary> /// Determines whether the specified type is a float/half/double. /// </summary> /// <param name="type">The type.</param> /// <returns> /// <c>true</c> if the specified type is float/half/double; otherwise, <c>false</c>. /// </returns> public static bool IsFloat(TypeBase type) { return(type == Float || type == Double || type == Half); }
/// <summary> /// Initializes a new instance of the <see cref="ArrayType"/> class. /// </summary> /// <param name="type">The type.</param> /// <param name="dimensions">The dimensions.</param> public ArrayType(TypeBase type, params Expression[] dimensions) : base("$array") { Type = type; Dimensions = new List <Expression>(); Dimensions.AddRange(dimensions); }
/// <summary> /// Initializes a new instance of the <see cref="Parameter"/> class. /// </summary> /// <param name="type">The type.</param> /// <param name="name">The name.</param> /// <param name="initialValue">The initial value.</param> public Parameter(TypeBase type, string name = null, Expression initialValue = null) : base(type, name, initialValue) { }
/// <summary> /// Initializes a new instance of the <see cref="TypeName"/> class. /// </summary> /// <param name="typeBase">The type base.</param> public TypeName(TypeBase typeBase) : base(typeBase.Name) { TypeInference.TargetType = typeBase; }