libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
token.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "def.h"
11#include "enum/make.h"
12#include "loc.h"
13#include "util/dynarr.h"
14
19// See file for associated comments
20#define ENUM TO_ENUM
21#include "token_type.h"
22#undef ENUM
24};
25
30
40
42
46struct ps_token_arr ps_dynarr(struct ps_token);
47#define ps_token_arr_new() ps_dynarr_new(struct ps_token_arr)
48#define ps_token_arr_free(arr) ps_dynarr_free(arr)
Base definitions.
#define STR
Definition def.h:40
#define usize
Definition def.h:50
Defines a dynamically-allocated array template.
#define ps_dynarr(T)
Definition dynarr.h:28
File location structure.
Retrieval of associated data from custom enum (see enum.h).
#define PS_PRINT_DECL(T)
Definition print.h:9
Represents a token location.
Definition loc.h:16
Represents a token.
Definition token.h:34
usize length
Definition token.h:38
enum ps_token_type type
Definition token.h:36
struct ps_loc loc
Definition token.h:35
STR start
Definition token.h:37
STR ps_token_type_to_string(enum ps_token_type type)
Returns: the string representation of the given token type type.
Definition token.c:13
ps_token_type
The type of a token.
Definition token.h:18
@ PS_TOKEN_TYPES_NUMBER
Definition token.h:23
All token types.