OpenMS
Loading...
Searching...
No Matches
ProFormaTokenizer::Token Struct Reference

A single token from the input stream. More...

#include <OpenMS/CHEMISTRY/ProFormaTokenizer.h>

Collaboration diagram for ProFormaTokenizer::Token:
[legend]

Public Member Functions

bool isEnd () const
 Check if this is an end-of-input token.
 
bool is (TokenType t) const
 Check if this token is a specific single-character type.
 

Public Attributes

TokenType type
 The type of this token.
 
std::string_view text
 View into the original input (zero-copy)
 
size_t position
 Byte offset in the original input (0-indexed)
 

Detailed Description

A single token from the input stream.

Tokens store their type, a view of the original text, and the byte position in the input for error reporting.

Member Function Documentation

◆ is()

bool is ( TokenType  t) const
inline

Check if this token is a specific single-character type.

◆ isEnd()

bool isEnd ( ) const
inline

Check if this is an end-of-input token.

Member Data Documentation

◆ position

size_t position

Byte offset in the original input (0-indexed)

◆ text

std::string_view text

View into the original input (zero-copy)

◆ type

TokenType type

The type of this token.