public void AddDistinct(ScanPatterns Patterns) { foreach (var pat in Patterns) { AddDistinct(pat); } }
public static ScanPatterns operator +(ScanPatterns InValue1, ScanPatterns InValue2) { ScanPatterns rv = new ScanPatterns(InValue1); rv.AddDistinct(InValue2); return(rv); }
public void Add(ScanPatterns Patterns) { foreach (var pattern in Patterns) { this.Add(pattern); } }
public void Add(ScanPatterns Patterns) { foreach (var pattern in Patterns) { this.Add(pattern.Duplicate( )); } }
public void Add(ScanPatterns InPatterns, DelimClassification InDelimClass) { foreach (ScanPattern pat in InPatterns) { base.Add(pat.PatternValue); mWip.Add(InDelimClass); } }
public KeywordPattern(KeywordPattern Pattern) : base(Pattern) { this.CompareCase = Pattern.CompareCase; this.ReplacementValue = Pattern.ReplacementValue; this.WhitespacePatterns = Pattern.WhitespacePatterns; this.UserCode = Pattern.UserCode; }
public void AddDistinct(ScanPatterns Patterns) { foreach (var pat in Patterns) { Add(pat.Duplicate()); continue; } }
/// <summary> /// Match a location in the input text string to a whitespace separated keyword /// pattern. /// </summary> /// <param name="Text"></param> /// <param name="Ix"></param> /// <param name="WhitespacePatterns"></param> /// <returns></returns> private Tuple <bool, int> EqualsWhitespaceSeparatedParts( string Text, int Ix, ScanPatterns WhitespacePatterns) { bool doesMatch = false; int ix = Ix; int nbrParts = this._PatternValueParts.Length; int partIx = 0; int cummMatchLx = 0; // the start of the match. int bx = Ix; while (true) { string patPart = this._PatternValueParts[partIx]; // match the current part of the keyword pattern to the input text string. var rv = EqualsText(patPart, this.CompareCase, Text, ix); bool isMatch = rv.Item1; int matchLx = rv.Item2; // not a match. break out. if (isMatch == false) { doesMatch = false; break; } cummMatchLx += matchLx; // this is the last part. the full pattern is a match. if ((partIx + 1) == nbrParts) { doesMatch = true; break; } // advance past whitespace. ix = Ix + cummMatchLx; int fx = Scanner.ScanNotEqual(Text, WhitespacePatterns, ix); // no whitespace. not a match. if (fx == ix) { doesMatch = false; break; } // total up the match length up to the last whitespace char. ix = fx; cummMatchLx = ix - Ix; partIx += 1; } return(new Tuple <bool, int>(doesMatch, cummMatchLx)); }
public void AddDistinct(ScanPatterns Patterns, DelimClassification DelimClass) { foreach (ScanPattern pat in Patterns) { int px = base.AddDistinct(pat.PatternValue); if (px != -1) { mWip.Add(DelimClass); } } }
void DelimPatterns_ScanPatternsChanged(ScanPatterns InPatterns) { mDelims = null; }
public void Replace(ScanPatterns Patterns) { Clear(); Add(Patterns); }
public bool ContainsAll(ScanPatterns InPatterns) { bool containsAll = ContainsAll(InPatterns.StringArray); return(containsAll); }