public RegexInterpreter(RegexInterpreterCode code, CultureInfo culture) { Debug.Assert(code != null, "code must not be null."); Debug.Assert(culture != null, "culture must not be null."); _code = code; _textInfo = culture.TextInfo; }
public RegexInterpreterFactory(RegexTree tree) { // We use the CultureInfo field from the tree's culture which will only be set to an actual culture if the // tree contains IgnoreCase backreferences. If the tree doesn't have IgnoreCase backreferences, then we keep _culture as null. _culture = tree.Culture; // Generate and store the RegexInterpretedCode for the RegexTree and the specified culture _code = RegexWriter.Write(tree); }
/// <summary> /// Emits a zero-argument operation. Note that the emit /// functions all run in two modes: they can emit code, or /// they can just count the size of the code. /// </summary> private void Emit(RegexOpcode op) { if (RegexInterpreterCode.OpcodeBacktracks(op)) { _trackCount++; } _emitted.Append((int)op); }