예제 #1
0
        public override bool ResolveErrorsForward(int level)
        {
            // End too many recursive calls
            if (Recursive)
            {
                string name = Value;

                LoopLevel loop = TextBuffer.GetLoopForward(this);
                if (loop.LastInvokePos == TextBuffer.PointerNextChar &&
                    level > loop.LastInvokeLevel)
                {
                    return(false);
                }
                loop.LastInvokePos   = TextBuffer.PointerNextChar;
                loop.LastInvokeLevel = level;
            }

            return(RuleElement.ResolveErrorsForward(level + 1));
        }
예제 #2
0
        /// <returns>0: Not found, 1: Found-read error, 2: Found and read ok.</returns>
        public override int ResolveErrorsLast(CodeElement last, int level)
        {
            // End too many recursive calls
            if (Recursive)
            {
                string name = Value;

                LoopLevel loop = TextBuffer.GetLoopLast(this);
                if (loop.LastInvokePos == TextBuffer.PointerNextChar &&
                    level > loop.LastInvokeLevel)
                {
                    return(1);
                }
                loop.LastInvokePos   = TextBuffer.PointerNextChar;
                loop.LastInvokeLevel = level;
            }

            return(RuleElement.ResolveErrorsLast(last, level + 1));
        }
예제 #3
0
        public override bool Load(List <TextElement> outElements, int level)
        {
            // End too many recursive calls
            if (Recursive)
            {
                string name = Value;

                LoopLevel loop = TextBuffer.GetLoopLoad(this);
                if (loop.LastInvokePos == TextBuffer.PointerNextChar &&
                    level > loop.LastInvokeLevel)
                {
                    return(false);
                }
                loop.LastInvokePos   = TextBuffer.PointerNextChar;
                loop.LastInvokeLevel = level;
            }

            return(RuleElement.Load(outElements, level + 1));
        }