private void PushOneCharOrTwoCharToken(TokenKind kind, int pos, char[] data) { _tokens.Add(new Token(kind, data, pos, pos + kind.Length)); }
private void PushCharToken(TokenKind kind) { _tokens.Add(new Token(kind, _pos, _pos + 1)); _pos++; }
private void PushPairToken(TokenKind kind) { _tokens.Add(new Token(kind, _pos, _pos + 2)); _pos += 2; }
private bool IsTwoCharToken(TokenKind kind) { return(kind.TokenChars.Length == 2 && _charsToProcess[_pos] == kind.TokenChars[0] && _charsToProcess[_pos + 1] == kind.TokenChars[1]); }