Exemple #1
0
 public override bool Equals(object obj)
 {
     if (obj is LRNodeElement)
     {
         var t = obj as LRNodeElement;
         return(TerminalProduction.Equals(t.TerminalProduction) && GrammarRule.Equals(t.GrammarRule) && GrammarRule.DotPos.Equals(t.GrammarRule.DotPos));
     }
     return(base.Equals(obj));
 }
 public override bool Equals(object obj)
 {
     if (obj is LALRNodeElement)
     {
         var t = obj as LALRNodeElement;
         if (t.TerminalProductions.Count != TerminalProductions.Count || !GrammarRule.Equals(t.GrammarRule) || !GrammarRule.DotPos.Equals(t.GrammarRule.DotPos))
         {
             return(false);
         }
         for (int i = 0; i < TerminalProductions.Count; i++)
         {
             if (!t.TerminalProductions[i].Equals(TerminalProductions[i]))
             {
                 return(false);
             }
         }
         return(true);
     }
     return(false);
 }