예제 #1
0
 public void Repurpose(AdvanceableRule target)
 {
     Clear();
     Repurpose(target.name);
     //	if(!target.Name.Equals(Name))
     //	  Name = target.Name;
     for (int i = 0; i < target.Count; i++)
     {
         Add(target[i]);
     }
 }
예제 #2
0
        public AdvanceableRule(AdvanceableRule rule)
        {
#if GATHERING_STATS
            InstanceCount++;
            //		bornOn = DateTime.Now;
#endif
            name = rule.name;
            for (int i = 0; i < rule.Count; i++)
            {
                Add(rule[i]); //lets see what this does...
            }
        }
예제 #3
0
 public void Repurpose(string lookahead, AdvanceableRule r)
 {
     Clear();
     if (!r.Name.Equals(base.Name))
     {
         base.Name = r.Name;
     }
     if (!lookahead.Equals(LookaheadSymbol))
     {
         lookaheadSymbol = lookahead;
     }
     for (int i = 0; i < r.Count; i++)
     {
         Add(r[i]);
     }
 }
예제 #4
0
 protected bool Equals(AdvanceableRule rr)
 {
     if (!rr.name.Equals(name) || rr.Count != Count)
     {
         return(false);
     }
     else
     {
         for (int i = 0; i < Count; i++)
         {
             if (!this[i].Equals(rr[i]))
             {
                 return(false);
             }
         }
         return(true);
     }
 }
예제 #5
0
 int IEqualityComparer <AdvanceableRule> .GetHashCode(AdvanceableRule x)
 {
     return(x.GetHashCode0());
 }
예제 #6
0
 bool IEqualityComparer <AdvanceableRule> .Equals(AdvanceableRule x, AdvanceableRule y)
 {
     return(x.Equals(y));
 }
예제 #7
0
        public override bool Equals(object other)
        {
            AdvanceableRule rr = (AdvanceableRule)other;

            return(Equals(rr));
        }
예제 #8
0
        bool IAdvanceableRule.Equals(object other)
        {
            AdvanceableRule rr = (AdvanceableRule)other;

            return(Equals(rr));
        }
예제 #9
0
 public LookaheadRule(string lookaheadSymbol, AdvanceableRule rule)
     : base(rule)
 {
     this.lookaheadSymbol = lookaheadSymbol;
 }