SciLex
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Attributes | List of all members
scilex::token Struct Reference

One lexical token: a typed slice of the source. More...

#include <token.hpp>

Collaboration diagram for scilex::token:
[legend]

Public Attributes

int kind
 Caller-defined token kind (e.g. an enum value).
 
std::string_view lexeme
 The matched text, viewing into the source.
 
position start
 Position of the token's first byte.
 
std::size_t mode_id {0}
 The mode this token was lexed in (0 = the default/root mode).
 

Detailed Description

One lexical token: a typed slice of the source.

Definition at line 57 of file token.hpp.

Member Data Documentation

◆ kind

int scilex::token::kind

Caller-defined token kind (e.g. an enum value).

Definition at line 59 of file token.hpp.

◆ lexeme

std::string_view scilex::token::lexeme

The matched text, viewing into the source.

Definition at line 60 of file token.hpp.

◆ mode_id

std::size_t scilex::token::mode_id {0}

The mode this token was lexed in (0 = the default/root mode).

Definition at line 62 of file token.hpp.

◆ start

position scilex::token::start

Position of the token's first byte.

Definition at line 61 of file token.hpp.


The documentation for this struct was generated from the following file: