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

            _startPatternParts.Add(patternPart);
            return(patternPart);
        }
Beispiel #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);
            }
        }
Beispiel #3
0
        public IStartPatternPart NamedGroupStart(string groupName)
        {
            PatternPart patternPart = GroupStart as PatternPart;

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

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

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

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