private BnfToken Make(int length, BnfTokenType type) { var value = this.source.Substring(this.index, length); var token = new BnfToken(this.index, value, type); this.index += length; return(token); }
/// <summary> /// Initializes a new instance of the <see cref="BnfToken"/> class. /// </summary> /// <param name="index">The start index of the token in the source text.</param> /// <param name="value">The text value of the token.</param> /// <param name="type">The <see cref="BnfTokenType"/> of the token.</param> public BnfToken(int index, string value, BnfTokenType type) { this.Index = index; this.Value = value; this.Type = type; }