Converts atom-selection expression bytes into owned parser tokens. More...
#include <SelectionTokenizer.h>
Static Public Member Functions | |
| static std::vector< SelectionToken > | tokenize (const std::string_view selectionString) |
| Tokenizes one atom-selection expression. | |
Converts atom-selection expression bytes into owned parser tokens.
The tokenizer is stateless and operates synchronously on the calling host thread. It skips whitespace, recognizes parentheses and range separators, classifies supported dotted operators and bare keywords without regard to ASCII letter case, and appends exactly one SelectionTokenType::End token. Every nonterminal token owns a copy of its source spelling.
The tokenizer performs no PSF access, CUDA operation, transfer, stream work, or synchronization. It provides no internal locking, but independent calls share no mutable state.
|
static |
Tokenizes one atom-selection expression.
Source positions are zero-based byte offsets. The current implementation stores them in int, so expressions longer than INT_MAX bytes cannot preserve positions reliably.
| [in] | selectionString | Borrowed expression view. The referenced bytes need not be null-terminated and are not retained. Embedded control bytes, including \0, are rejected unless classified as whitespace by the C locale. |
selectionString.size() after narrowing to int. | ApoCharmmError | With ApoCharmmErrorCode::InvalidArgument for an unterminated or unknown dotted operator, or for an unexpected source byte. |
| std::bad_alloc | If token, text, or diagnostic allocation fails. |
| std::length_error | If a token vector, token string, or diagnostic exceeds an implementation-defined limit. |
INT_MAX before narrowing token positions.