Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            ConcatenationRule other = obj as ConcatenationRule;

            if (other == null)
            {
                return(false);
            }

            if (terms.Count != other.terms.Count)
            {
                return(false);
            }

            for (int i = 0; i < terms.Count; i++)
            {
                if (!terms[i].Equals(other.terms[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
 public NonTerminal(string name, ConcatenationRule rule = null)
     : base(name)
 {
     Rules = rule;
 }
Ejemplo n.º 3
0
 internal ConcatenationRule(ConcatenationRule left, ConcatenationRule right)
 {
     terms.AddRange(left.terms);
     terms.AddRange(right.terms);
 }
Ejemplo n.º 4
0
 public Production(NonTerminal head, ConcatenationRule body)
 {
     Body = body.ToArray();
     Head = head;
 }