Example #1
0
 public AstIfNull(IAstRef value, IAstRefOrValue ifNullValue)
 {
     _value       = value;
     _ifNullValue = ifNullValue;
     if (!_value.itemType.IsAssignableFrom(_ifNullValue.itemType))
     {
         throw new EmitMapperException("Incorrect ifnull expression");
     }
 }
Example #2
0
 public AstIfNull(IAstRef value, IAstRefOrValue ifNullValue)
 {
     _value = value;
     _ifNullValue = ifNullValue;
     if (!_value.itemType.IsAssignableFrom(_ifNullValue.itemType))
     {
         throw new EmitMapperException("Incorrect ifnull expression");
     }
 }
Example #3
0
    /// <summary>
    ///   Reads the array item r a.
    /// </summary>
    /// <param name="array">The array.</param>
    /// <param name="index">The index.</param>
    /// <returns>An IAstRefOrAddr.</returns>
    public static IAstRefOrAddr ReadArrayItemRA(IAstRef array, int index)
    {
        if (array.ItemType.IsValueType)
        {
            return new AstReadArrayItemAddr {
                       Array = array, Index = index
            }
        }
        ;

        return(new AstReadArrayItemRef {
            Array = array, Index = index
        });
    }
Example #4
0
 public static IAstRefOrAddr ReadArrayItemRA(IAstRef array, int index)
 {
     if (array.itemType.IsValueType)
     {
         return(new AstReadArrayItemAddr()
         {
             array = array,
             index = index
         });
     }
     else
     {
         return(new AstReadArrayItemRef()
         {
             array = array,
             index = index
         });
     }
 }
 public static IAstRefOrValue ReadArrayItemRV(IAstRef array, int index)	
 {
     if (array.itemType.IsValueType)
     {
         return new AstReadArrayItemValue()
                    {
                        array = array,
                        index = index
                    };
     }
     else
     {
         return new AstReadArrayItemRef()
                    {
                        array = array,
                        index = index
                    };
     }
 }
Example #6
0
 public static IAstRefOrValue ReadArrayItemRV(IAstRef array, int index)
 {
     if (array.itemType.IsValueType())
     {
         return(new AstReadArrayItemValue()
         {
             array = array,
             index = index
         });
     }
     else
     {
         return(new AstReadArrayItemRef()
         {
             array = array,
             index = index
         });
     }
 }