public Subset(ParseElementCollection parent, Backend backend, string text, MatchMode mode) : base(parent._rule) { char[] achTrimChars = Helpers._achTrimChars; foreach (char c in achTrimChars) { if (c != ' ' && text.IndexOf(c) >= 0) { text = text.Replace(c, ' '); } } parent.AddArc(backend.SubsetTransition(text, mode)); }
/// <summary> /// Process the 'subset' element. /// </summary> public Subset(ParseElementCollection parent, Backend backend, string text, MatchMode mode) : base(parent._rule) { // replace tab, cr, lf with spaces foreach (char ch in Helpers._achTrimChars) { if (ch == ' ') { continue; } if (text.IndexOf(ch) >= 0) { text = text.Replace(ch, ' '); } } // Add transition to the new state with normalized token. parent.AddArc(backend.SubsetTransition(text, mode)); }