Esempio n. 1
0
        public IDottedRule Get(IProduction production, int position)
        {
            var hashCode = production.GetHashCode();

            if (!_dottedRuleIndex.TryGetValue(hashCode, out Dictionary <int, IDottedRule> positionIndex))
            {
                return(null);
            }
            if (!positionIndex.TryGetValue(position, out IDottedRule dottedRule))
            {
                return(null);
            }
            return(dottedRule);
        }
Esempio n. 2
0
 private static int ComputeHashCode(IProduction production, int position)
 {
     return(HashCode.Compute(production.GetHashCode(), position.GetHashCode()));
 }