public override bool IsEquivalent(TypeExpression otherType) { return((otherType.PrimitiveType is StringType) || (otherType is NilType)); }
public override bool IsEquivalent(TypeExpression otherType) { return(PrimitiveType.IsEquivalent(otherType)); }
public override TypeExpression SubscriptAt(TypeExpression index) { return(PrimitiveType.SubscriptAt(index)); }
/* * Summary * * The main objective of these methods is calculated or deduce the type expression result of apply a language's operator * */ /// <summary> /// the main objective of this method is calculated or deduce the type expression result of apply operator "[]" /// </summary> /// <param name="index">index type must be integer and reference an item of collection</param> /// <returns>type expression that be storaged in collection </returns> public virtual TypeExpression SubscriptAt(TypeExpression index) { return(new ErrorType(string.Format("Invalid operation. Operator \"[]\" is not supported by type {0}", Identifier))); }
public AliasType(TypeExpression renamedType, string targetName, long scopeId) : base(targetName, TypeConstructor.Alias, scopeId) { RenamedType = renamedType; }
/// <summary> /// the main objective of this method is equivalenty checking of type expressions /// </summary> public abstract bool IsEquivalent(TypeExpression otherType);
public override bool IsEquivalent(TypeExpression otherType) { return(otherType is VoidType); }
public override TypeExpression SubscriptAt(TypeExpression index) { return((index.PrimitiveType is IntegerType) ? BaseType : new ErrorType(string.Format("Argument type \"{0}\" is not assignable to parameter type int", index.Identifier))); }
public ArrayType(string identifier, TypeExpression type, long scopeId) : base(identifier, TypeConstructor.Array, scopeId) { BaseType = type; }
public override bool IsEquivalent(TypeExpression otherType) { return(otherType.PrimitiveType is IntegerType); }