libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
token.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5#include "dstring.h"
6
29
33typedef struct token
34{
36 unsigned int line;
37 unsigned int column;
38 long long int value;
43
44extern const char* mya_token_types[];
const char * mya_token_types[]
Definition globals.c:44
Struct for a Mya token.
Definition token.h:34
long long int value
Integer value of the token.
Definition token.h:38
token_type_t type
Token type.
Definition token.h:35
dstring_t lexeme
Lexeme of the token.
Definition token.h:41
unsigned int line
Token line inside the module.
Definition token.h:36
unsigned int column
Column of the token position on the line.
Definition token.h:37
struct dstring dstring_t
A dynamic string (dstring) that automatically reallocate her buffer when needed.
enum token_type token_type_t
Enumeration of token types.
struct token token_t
Struct for a Mya token.
token_type
Enumeration of token types.
Definition token.h:11
@ TK_OPEN_BRACKET
Definition token.h:23
@ TK_NUMBER
Definition token.h:21
@ TK_STRING
Definition token.h:27
@ TK_IDENTIFIER
Definition token.h:19
@ TK_COLON
Definition token.h:15
@ TK_OPEN_BRACES
Definition token.h:22
@ TK_OPEN_PARENS
Definition token.h:24
@ TK_COMMA
Definition token.h:16
@ TK_CLOSE_PARENS
Definition token.h:14
@ TK_KEYWORD
Definition token.h:20
@ TK_OPERATOR
Definition token.h:25
@ TK_CLOSE_BRACKET
Definition token.h:13
@ TK_EOF
Definition token.h:17
@ TK_CLOSE_BRACES
Definition token.h:12
@ TK_EQUAL
Definition token.h:18
@ TK_SEMICOLON
Definition token.h:26