Exemple #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]);
     }
 }
Exemple #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...
            }
        }
Exemple #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]);
     }
 }
Exemple #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);
     }
 }
Exemple #5
0
 int IEqualityComparer <AdvanceableRule> .GetHashCode(AdvanceableRule x)
 {
     return(x.GetHashCode0());
 }
Exemple #6
0
 bool IEqualityComparer <AdvanceableRule> .Equals(AdvanceableRule x, AdvanceableRule y)
 {
     return(x.Equals(y));
 }
Exemple #7
0
        public override bool Equals(object other)
        {
            AdvanceableRule rr = (AdvanceableRule)other;

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

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