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(allocator, ...)    token_types_to_friendly_string_va(allocator, __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 (hb_allocator_T *allocator, const token_T *token)
 
hb_string_T token_type_to_string (token_type_T type)
 
hb_string_T token_type_to_friendly_string (token_type_T type)
 
char * token_types_to_friendly_string_va (hb_allocator_T *allocator, token_type_T first_token,...)
 
char * token_types_to_friendly_string_valist (hb_allocator_T *allocator, token_type_T first_token, va_list args)
 
hb_string_T token_value (const token_T *token)
 
int token_type (const token_T *token)
 
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 (   allocator,
  ... 
)     token_types_to_friendly_string_va(allocator, __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 ( hb_allocator_T *  allocator,
const token_T token 
)

◆ token_type_to_string()

hb_string_T token_type_to_string ( token_type_T  type)

◆ token_type_to_friendly_string()

hb_string_T token_type_to_friendly_string ( token_type_T  type)

◆ token_types_to_friendly_string_va()

char * token_types_to_friendly_string_va ( hb_allocator_T *  allocator,
token_type_T  first_token,
  ... 
)

◆ token_types_to_friendly_string_valist()

char * token_types_to_friendly_string_valist ( hb_allocator_T *  allocator,
token_type_T  first_token,
va_list  args 
)

◆ token_value()

hb_string_T token_value ( const token_T token)

◆ token_type()

int token_type ( const token_T token)

◆ 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)