예제 #1
0
        private CachedDottedRuleSetTransition CreateTopCachedItem(
            DeterministicState stateFrame,
            ISymbol postDotSymbol)
        {
            var origin = stateFrame.Origin;
            CachedDottedRuleSetTransition topCacheItem = null;

            // search for the top item in the leo chain
            while (true)
            {
                var originFrameSet = Chart.Sets[stateFrame.Origin];
                var nextCachedItem = originFrameSet.FindCachedDottedRuleSetTransition(postDotSymbol);
                if (nextCachedItem == null)
                {
                    break;
                }
                topCacheItem = nextCachedItem;
                if (origin == nextCachedItem.Origin)
                {
                    break;
                }
                origin = topCacheItem.Origin;
            }

            return(new CachedDottedRuleSetTransition(
                       postDotSymbol,
                       stateFrame.DottedRuleSet,
                       topCacheItem == null ? stateFrame.Origin : origin));
        }
예제 #2
0
        private void LeoReductionOperation(int iLoc, CachedDottedRuleSetTransition fromLim)
        {
            var fromAH    = fromLim.DottedRuleSet;
            var transSym  = fromLim.Symbol;
            var originLoc = fromLim.Origin;

            var toAH = Goto(fromAH, transSym);

            if (toAH == null)
            {
                return;
            }

            AddEimPair(iLoc, toAH, originLoc);
        }