Example #1
0
        public IStartPatternPart StartPattern()
        {
            PatternPart patternPart = new PatternPart(_rGG, this, PartType.PatternStart);

            _startPatternParts.Add(patternPart);
            return(patternPart);
        }
Example #2
0
        private PatternPart NewPatternPart(PartType newPattrenPartType)
        {
            PatternPart patternPart = new PatternPart(RGG, Pattern, newPattrenPartType);

            switch (PartType)
            {
            case PartType.PatternEnd:
                NextPatternPart = patternPart;
                return(null);

            case PartType.GroupStart:
                GroupStartPatternPart = this;
                GroupEndPatternPart   = new PatternPart(RGG, Pattern, PartType.GroupEnd);
                GroupEndPatternPart.GroupStartPatternPart = this;
                NextPatternPart = GroupEndPatternPart;
                patternPart.ParentStartPatternPart = this;
                patternPart.ParentEndPatternPart   = GroupEndPatternPart;
                ChildPatternParts.Add(patternPart);
                return(patternPart);

            default:
                NextPatternPart = patternPart;
                patternPart.ParentStartPatternPart = ParentStartPatternPart;
                patternPart.ParentEndPatternPart   = ParentEndPatternPart;
                return(patternPart);
            }
        }
Example #3
0
        public IStartPatternPart NamedGroupStart(string groupName)
        {
            PatternPart patternPart = GroupStart as PatternPart;

            patternPart.Name = groupName;
            return(patternPart);
        }
Example #4
0
        public IPatternPart Terminal(string terminalPattern)
        {
            PatternPart patternPart = NewPatternPart(PartType.Terminal);

            patternPart.TerminalPattern = ConvertStringToPattern(terminalPattern);
            return(patternPart);
        }
Example #5
0
        public IPatternPart NonTerminal(string nonterminalName)
        {
            PatternPart patternPart = NewPatternPart(PartType.NonTerminal);

            patternPart.Name = nonterminalName;
            return(patternPart);
        }
Example #6
0
        public IStartPatternPart RepeatNext(int minRepeats, int?maxRepeats)
        {
            PatternPart patternPart = NewPatternPart(PartType.RepeatNext);

            patternPart.MinRepeats = minRepeats;
            patternPart.MaxRepeats = maxRepeats;
            return(patternPart);
        }