Exemple #1
0
        public override bool InitializeLoopHasWord(RuleLink link, List <RuleLink> subPath, ref bool linkFound)
        {
            foreach (ParserElementBase item in _otherForms)
            {
                if (item.InitializeLoopHasWord(link, subPath, ref linkFound))
                {
                    return(true);
                }
                else if (linkFound)
                {
                    return(false);
                }
            }

            return(false);
        }
Exemple #2
0
        public override bool InitializeLoopHasWord(RuleLink link, List <RuleLink> subPath, ref bool linkFound)
        {
            bool hasWord0 = ChildNodes[0].InitializeLoopHasWord(link, subPath, ref linkFound);

            if (linkFound)
            {
                return(hasWord0);
            }

            bool hasWord1 = ChildNodes[1].InitializeLoopHasWord(link, subPath, ref linkFound);

            if (linkFound)
            {
                return(hasWord1);
            }

            return(hasWord0 && hasWord1);
        }
Exemple #3
0
        public override bool InitializeLoopHasWord(RuleLink link, List <RuleLink> subPath, ref bool linkFound)
        {
            bool hasWord = false;

            foreach (ParserElementBase item in this.ChildNodes)
            {
                if (item.InitializeLoopHasWord(link, subPath, ref linkFound))
                {
                    hasWord = true;
                }

                if (linkFound)
                {
                    return(hasWord);
                }
            }

            return(false);
        }
Exemple #4
0
        public override bool InitializeLoopHasWord(RuleLink link, List <RuleLink> subPath, ref bool linkFound)
        {
            if (link != null && this == link)
            {
                linkFound = true;
                return(false);
            }

            int linkNo = subPath.IndexOf(this);

            if (linkNo > -1)
            {
                return(false); // no words, just recursive
            }
            subPath.Add(this);
            bool hasWord = RuleElement.InitializeLoopHasWord(null, subPath, ref linkFound);

            subPath.Remove(this);

            return(hasWord);
        }