AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.5.1" />

 BaseTokenizer

abstract class BaseTokenizer
Common methods and variables of all tokenizers.
using System; using System.Diagnostics; using System.Text; namespace AngleSharp.Parser { [DebuggerStepThrough] internal abstract class BaseTokenizer { protected StringBuilder _stringBuffer; protected SourceManager _src; public event EventHandler<ParseErrorEventArgs> ErrorOccurred; public BaseTokenizer(SourceManager source) { _src = source; _stringBuffer = new StringBuilder(); } protected void RaiseErrorOccurred(ErrorCode code) { if (this.ErrorOccurred != null) { ParseErrorEventArgs parseErrorEventArgs = new ParseErrorEventArgs((int)code, Errors.GetError(code)); parseErrorEventArgs.Line = _src.Line; parseErrorEventArgs.Column = _src.Column; this.ErrorOccurred(this, parseErrorEventArgs); } } protected void RaiseErrorOccurred(object sender, ParseErrorEventArgs eventArgs) { if (this.ErrorOccurred != null) this.ErrorOccurred(sender, eventArgs); } } }