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

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

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

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

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

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

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

            return base.Add(other);
        }
Exemplo n.º 8
0
 public override void Assign(AObject other)
 {
     if (other is AString)
     {
         Value = (other as AString).Value;
     }
     else
     {
         throw new InvalidTypeException();
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 10
0
 public virtual AObject Sub(AObject other)
 {
     throw new NotDefinedOperationException();
 }
Exemplo n.º 11
0
 public abstract void Assign(AObject other);
Exemplo n.º 12
0
        public override AObject Sub(AObject other)
        {
            if (other is AInteger)
            {
                return new AInteger(Value - (other as AInteger).Value);
            }

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

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

            return base.Lt(other);
        }