libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
token.h File Reference

Defines a token. More...

#include "def.h"
#include "enum/make.h"
#include "loc.h"
#include "util/dynarr.h"
#include "token_type.h"

Go to the source code of this file.

Data Structures

struct  ps_token
 Represents a token. More...
 

Macros

#define ENUM   TO_ENUM
 
#define ps_token_arr_new()   ps_dynarr_new(struct ps_token_arr)
 
#define ps_token_arr_free(arr)   ps_dynarr_free(arr)
 

Enumerations

enum  ps_token_type { PS_TOKEN_TYPES_NUMBER }
 The type of a token. More...
 

Functions

STR ps_token_type_to_string (enum ps_token_type type)
 Returns: the string representation of the given token type type.
 
 PS_PRINT_DECL (ps_token)
 
struct ps_token_arr ps_dynarr (struct ps_token)
 Represents a list of tokens.
 

Detailed Description

Defines a token.

Author
Ethan Uppal

Definition in file token.h.

Macro Definition Documentation

◆ ENUM

#define ENUM   TO_ENUM

Definition at line 20 of file token.h.

◆ ps_token_arr_free

#define ps_token_arr_free (   arr)    ps_dynarr_free(arr)

Definition at line 48 of file token.h.

◆ ps_token_arr_new

#define ps_token_arr_new ( )    ps_dynarr_new(struct ps_token_arr)

Definition at line 47 of file token.h.

Enumeration Type Documentation

◆ ps_token_type

The type of a token.

Enumerator
PS_TOKEN_TYPES_NUMBER 

Definition at line 18 of file token.h.

Function Documentation

◆ ps_dynarr()

struct ps_token_arr ps_dynarr ( struct ps_token  )

Represents a list of tokens.

◆ PS_PRINT_DECL()

PS_PRINT_DECL ( ps_token  )

◆ ps_token_type_to_string()

STR ps_token_type_to_string ( enum ps_token_type  type)

Returns: the string representation of the given token type type.

Definition at line 13 of file token.c.