Ejemplo n.º 1
0
 public virtual ValueBase Join(ValueBase other)
 {
     if (this.GetType() == typeof(SetValue) && other.GetType() == typeof(SetValue))
     {
         // Add sets.
         SetValue t      = (SetValue)this;
         SetValue o      = (SetValue)other;
         SetValue result = new SetValue();
         result.Add(t);
         result.Add(o);
         return(result);
     }
     else if (this.GetType() == typeof(SetValue))
     {
         SetValue t      = (SetValue)this;
         SetValue result = new SetValue();
         result.Add(t);
         result.Add(other);
         return(result);
     }
     else if (other.GetType() == typeof(SetValue))
     {
         SetValue o      = (SetValue)other;
         SetValue result = new SetValue();
         result.Add(o);
         result.Add(this);
         return(result);
     }
     else if (this.GetType() == typeof(Top))
     {
         return(other);
     }
     else if (other.GetType() == typeof(Top))
     {
         return(this);
     }
     else if (this.GetType() != other.GetType())
     {
         return(Bottom);
     }
     else if (this.GetType().Name.Contains("RValue"))
     {
         if (this == other)
         {
             return(this);
         }
         else
         {
             return(Bottom);
         }
     }
     else
     {
         return(Bottom);
     }
 }
Ejemplo n.º 2
0
        public void Add(ValueBase v)
        {
            ValueBase z = _set.Find((ValueBase x) =>
            {
                if (x.Equals(v))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });

            if (z != null)
            {
                return;
            }
            _set.Add(v);
        }
Ejemplo n.º 3
0
 public void Add(SetValue v)
 {
     foreach (ValueBase e in v._set)
     {
         ValueBase z = _set.Find((ValueBase x) =>
         {
             if (x.Equals(v))
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         });
         if (z == null)
         {
             _set.Add(e);
         }
     }
 }
Ejemplo n.º 4
0
 public SetValue(ValueBase v)
 {
     _set.Add(v);
 }