Example #1
0
 public int CompareTo(object obj)
 {
     if (obj is IsInListPredicate)
     {
         IsInListPredicate other = (IsInListPredicate)obj;
         if (Inverse == other.Inverse)
         {
             if (members.Count == other.members.Count)
             {
                 for (int i = 0; i < members.Count; i++)
                 {
                     if (members[i] != other.members[i])
                     {
                         return(-1);
                     }
                 }
                 return(0); //members.CompareTo(other.members);
             }
         }
     }
     return(-1);
 }
Example #2
0
		/// Implements <NumLiteralList> ::= <NumLiteral>      
        public  Reduction CreateRULE_NUMLITERALLIST(Reduction reduction)
		{
			if(NCacheLog.IsInfoEnabled) NCacheLog.Info("CreateRULE_NUMLITERALLIST");
            IsInListPredicate pred = new IsInListPredicate();
            pred.Append(((Reduction)reduction.GetToken(0).Data).Tag);
            reduction.Tag = pred;
			return null;
		}
Example #3
0
		//========================


        public  Reduction CreateInclusionList(Reduction reduction)
		{
			object tag = ((Reduction)reduction.GetToken(2).Data).Tag;
			IsInListPredicate inc = null;
			if(tag is IsInListPredicate)
				inc = tag as IsInListPredicate;
			else
			{
                inc = new IsInListPredicate();
				inc.Append(tag);
			}
			inc.Append(((Reduction)reduction.GetToken(0).Data).Tag);
			reduction.Tag = inc;
			return null;
		}
Example #4
0
		/// Implements <InList> ::= '(' <ListType> ')'      
        public  Reduction CreateRULE_INLIST_LPARAN_RPARAN(Reduction reduction)
		{
			if(NCacheLog.IsInfoEnabled) NCacheLog.Info("CreateRULE_INLIST_LPARAN_RPARAN");
            object obj = ((Reduction)((Token)reduction.GetToken(1)).Data).Tag;
            
            if (obj is ConstantValue || obj is RuntimeValue)
            {
                IsInListPredicate pred = new IsInListPredicate();
                pred.Append(obj);
                reduction.Tag = pred;
            }
            else
            {
                reduction.Tag = ((Reduction)((Token)reduction.GetToken(1)).Data).Tag;
            }
			
            return null;
		}