Tokenizer support

Template class Genode::Token

Token

Template argument
typename SCANNER_POLICY Policy that defines the way of token scanning

This class is used to group characters of a string which belong to one syntactical token types number, identifier, string, whitespace or another single character.

See Scanner_policy_identifier_with_underline for an example scanner policy.

Public definitions

Enum: Type

Public functions

Token

Constructor

Arguments
char * s Start of string to construct a token from
size_t max_len Maximum token length

The max_len argument is useful for processing character arrays that are not null-terminated.

bool

Return true if token is valid

Return

operator

len

Return

size_t

start

Accessors

Return

char *

string

Return token as null-terminated string

Arguments
char * dst
size_t max_len

type

Return

Type