Example #1
0
        public override AObject Neq(AObject other)
        {
            if (other is AString)
            {
                return new ABoolean(Value != (other as AString).Value);
            }

            return base.Neq(other);
        }
Example #2
0
        public override AObject Ladd(AObject other)
        {
            if (other is ABoolean)
            {
                return new ABoolean(Value || (other as ABoolean).Value);
            }

            return base.Ladd(other);
        }
Example #3
0
        public override AObject Lmul(AObject other)
        {
            if (other is ABoolean)
            {
                return new ABoolean(Value && (other as ABoolean).Value);
            }

            return base.Lmul(other);
        }
Example #4
0
        public override AObject Ge(AObject other)
        {
            if (other is AInteger)
            {
                return new ABoolean(Value >= (other as AInteger).Value);
            }

            return base.Ge(other);
        }
Example #5
0
        public override AObject Eq(AObject other)
        {
            if (other is ABoolean)
            {
                return new ABoolean(Value == (other as ABoolean).Value);
            }

            return base.Eq(other);
        }
Example #6
0
        public override AObject Div(AObject other)
        {
            if (other is AInteger)
            {
                return new AInteger(Value / (other as AInteger).Value);
            }

            return base.Div(other);
        }
Example #7
0
        public override AObject Add(AObject other)
        {
            if (other is AInteger)
            {
                return new AInteger(Value + (other as AInteger).Value);
            }

            return base.Add(other);
        }
Example #8
0
 public override void Assign(AObject other)
 {
     if (other is AString)
     {
         Value = (other as AString).Value;
     }
     else
     {
         throw new InvalidTypeException();
     }
 }
Example #9
0
        public override AObject Add(AObject other)
        {
            if (other is AString)
            {
                return new AString(Value + (other as AString).Value);
            }

            if (other is AInteger)
            {
                return new AString(Value + (other as AInteger).Value.ToString());
            }

            return base.Add(other);
        }
Example #10
0
 public virtual AObject Sub(AObject other)
 {
     throw new NotDefinedOperationException();
 }
Example #11
0
 public abstract void Assign(AObject other);
Example #12
0
        public override AObject Sub(AObject other)
        {
            if (other is AInteger)
            {
                return new AInteger(Value - (other as AInteger).Value);
            }

            return base.Sub(other);
        }
Example #13
0
        public override AObject Mul(AObject other)
        {
            if (other is AInteger)
            {
                return new AInteger(Value * (other as AInteger).Value);
            }

            return base.Mul(other);
        }
Example #14
0
        public override AObject Lt(AObject other)
        {
            if (other is AInteger)
            {
                return new ABoolean(Value < (other as AInteger).Value);
            }

            return base.Lt(other);
        }