public IStartPatternPart StartPattern() { PatternPart patternPart = new PatternPart(_rGG, this, PartType.PatternStart); _startPatternParts.Add(patternPart); return(patternPart); }
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); } }
public IStartPatternPart NamedGroupStart(string groupName) { PatternPart patternPart = GroupStart as PatternPart; patternPart.Name = groupName; return(patternPart); }
public IPatternPart Terminal(string terminalPattern) { PatternPart patternPart = NewPatternPart(PartType.Terminal); patternPart.TerminalPattern = ConvertStringToPattern(terminalPattern); return(patternPart); }
public IPatternPart NonTerminal(string nonterminalName) { PatternPart patternPart = NewPatternPart(PartType.NonTerminal); patternPart.Name = nonterminalName; return(patternPart); }
public IStartPatternPart RepeatNext(int minRepeats, int?maxRepeats) { PatternPart patternPart = NewPatternPart(PartType.RepeatNext); patternPart.MinRepeats = minRepeats; patternPart.MaxRepeats = maxRepeats; return(patternPart); }