Herb C Reference
Loading...
Searching...
No Matches
token.h File Reference
#include "lexer_struct.h"
#include "position.h"
#include "token_struct.h"
#include "util/hb_allocator.h"
#include "util/hb_string.h"
#include <stdarg.h>

Go to the source code of this file.

Macros

#define token_types_to_friendly_string(...)   token_types_to_friendly_string_va(__VA_ARGS__, TOKEN_SENTINEL)
 

Functions

token_Ttoken_init (hb_string_T value, token_type_T type, lexer_T *lexer)
 
hb_string_T token_to_string (const token_T *token)
 
const char * token_type_to_string (token_type_T type)
 
const char * token_type_to_friendly_string (token_type_T type)
 
char * token_types_to_friendly_string_va (token_type_T first_token,...)
 
char * token_types_to_friendly_string_valist (token_type_T first_token, va_list args)
 
token_Ttoken_copy (token_T *token, hb_allocator_T *allocator)
 
void token_free (token_T *token, hb_allocator_T *allocator)
 
bool token_value_empty (const token_T *token)
 

Macro Definition Documentation

◆ token_types_to_friendly_string

#define token_types_to_friendly_string (   ...)    token_types_to_friendly_string_va(__VA_ARGS__, TOKEN_SENTINEL)

Function Documentation

◆ token_init()

token_T * token_init ( hb_string_T  value,
token_type_T  type,
lexer_T lexer 
)

◆ token_to_string()

hb_string_T token_to_string ( const token_T token)

◆ token_type_to_string()

const char * token_type_to_string ( token_type_T  type)

◆ token_type_to_friendly_string()

const char * token_type_to_friendly_string ( token_type_T  type)

◆ token_types_to_friendly_string_va()

char * token_types_to_friendly_string_va ( token_type_T  first_token,
  ... 
)

◆ token_types_to_friendly_string_valist()

char * token_types_to_friendly_string_valist ( token_type_T  first_token,
va_list  args 
)

◆ token_copy()

token_T * token_copy ( token_T token,
hb_allocator_T *  allocator 
)

◆ token_free()

void token_free ( token_T token,
hb_allocator_T *  allocator 
)

◆ token_value_empty()

bool token_value_empty ( const token_T token)