コード例 #1
0
ファイル: StringType.cs プロジェクト: MarioTheOne/Tigertron
 public override bool IsEquivalent(TypeExpression otherType)
 {
     return((otherType.PrimitiveType is StringType) || (otherType is NilType));
 }
コード例 #2
0
ファイル: AliasType.cs プロジェクト: MarioTheOne/Tigertron
 public override bool IsEquivalent(TypeExpression otherType)
 {
     return(PrimitiveType.IsEquivalent(otherType));
 }
コード例 #3
0
ファイル: AliasType.cs プロジェクト: MarioTheOne/Tigertron
 public override TypeExpression SubscriptAt(TypeExpression index)
 {
     return(PrimitiveType.SubscriptAt(index));
 }
コード例 #4
0
        /*
         * 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)));
        }
コード例 #5
0
ファイル: AliasType.cs プロジェクト: MarioTheOne/Tigertron
 public AliasType(TypeExpression renamedType, string targetName, long scopeId)
     : base(targetName, TypeConstructor.Alias, scopeId)
 {
     RenamedType = renamedType;
 }
コード例 #6
0
 /// <summary>
 /// the main objective of this method is equivalenty checking of type expressions
 /// </summary>
 public abstract bool IsEquivalent(TypeExpression otherType);
コード例 #7
0
 public override bool IsEquivalent(TypeExpression otherType)
 {
     return(otherType is VoidType);
 }
コード例 #8
0
ファイル: ArrayType.cs プロジェクト: MarioTheOne/Tigertron
 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)));
 }
コード例 #9
0
ファイル: ArrayType.cs プロジェクト: MarioTheOne/Tigertron
 public ArrayType(string identifier, TypeExpression type, long scopeId)
     : base(identifier, TypeConstructor.Array, scopeId)
 {
     BaseType = type;
 }
コード例 #10
0
 public override bool IsEquivalent(TypeExpression otherType)
 {
     return(otherType.PrimitiveType is IntegerType);
 }