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 "dstring.h"
4
27
31typedef struct token
32{
34 unsigned int line;
35 unsigned int column;
36 long long int value;
39
40extern const char* mya_token_types[];
const char * mya_token_types[]
Definition globals.c:36
Struct for a Mya token.
Definition token.h:32
long long int value
Integer value of the token on TK_NUMBER tokens.
Definition token.h:36
token_type_t type
Token type.
Definition token.h:33
dstring_t lexeme
Lexeme of the token.
Definition token.h:37
unsigned int line
Token line inside the module.
Definition token.h:34
unsigned int column
Column of the token position on the line.
Definition token.h:35
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:9
@ TK_OPEN_BRACKET
Definition token.h:21
@ TK_NUMBER
Definition token.h:19
@ TK_STRING
Definition token.h:25
@ TK_IDENTIFIER
Definition token.h:17
@ TK_COLON
Definition token.h:13
@ TK_OPEN_BRACES
Definition token.h:20
@ TK_OPEN_PARENS
Definition token.h:22
@ TK_COMMA
Definition token.h:14
@ TK_CLOSE_PARENS
Definition token.h:12
@ TK_KEYWORD
Definition token.h:18
@ TK_OPERATOR
Definition token.h:23
@ TK_CLOSE_BRACKET
Definition token.h:11
@ TK_EOF
Definition token.h:15
@ TK_CLOSE_BRACES
Definition token.h:10
@ TK_EQUAL
Definition token.h:16
@ TK_SEMICOLON
Definition token.h:24