コード例 #1
0
 internal void ReferenceBucketFromTarget(PredictionTreeDFAContext context, ProductionRuleLookAheadBucket bucket)
 {
     if (this.referencedBuckets == null)
     {
         this.referencedBuckets = new Dictionary <ProductionRuleLookAheadBucket, PredictionTreeDFAContext>();
     }
     if (!this.referencedBuckets.ContainsKey(bucket))
     {
         this.referencedBuckets.Add(bucket, context);
     }
 }
コード例 #2
0
        internal ProductionRuleLookAheadBucket CreateBucket(PredictionTreeDFAContext bucketOwner)
        {
            if (this.automationBuckets == null)
            {
                this.automationBuckets = new Dictionary <PredictionTreeDFAContext, ProductionRuleLookAheadBucket>();
            }
            ProductionRuleLookAheadBucket result;

            if (!this.automationBuckets.TryGetValue(bucketOwner, out result))
            {
                this.automationBuckets.Add(bucketOwner, result = new ProductionRuleLookAheadBucket()
                {
                    Owner = bucketOwner, BucketID = this.automationBuckets.Count + 1
                });
            }
            if (!bucketUseCount.ContainsKey(result))
            {
                bucketUseCount.Add(result, 0);
            }
            bucketUseCount[result]++;
            return(result);
        }