LexLeo 0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
lexleo_token_t Struct Reference

#include <lexleo_token.h>

Data Fields

lexleo_token_kind_t kind
 
union { 
 
   int   int_value 
 
   char *   string_value 
 
   char *   symbol_value 
 
as 
 

Detailed Description

Lexical token.

Ownership rules:

  • For LEX_TK_STRING and LEX_TK_SYMBOL_NAME, string_value is heap-allocated and ownership is transferred to the token consumer.
  • For other token kinds, the union content is unspecified.

Definition at line 67 of file lexleo_token.h.

Field Documentation

◆ [union]

union { ... } lexleo_token_t::as

◆ int_value

int lexleo_token_t::int_value

Definition at line 70 of file lexleo_token.h.

◆ kind

lexleo_token_kind_t lexleo_token_t::kind

Definition at line 68 of file lexleo_token.h.

◆ string_value

char* lexleo_token_t::string_value

Definition at line 71 of file lexleo_token.h.

◆ symbol_value

char* lexleo_token_t::symbol_value

Definition at line 72 of file lexleo_token.h.