libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
token.h File Reference
#include "dstring.h"
Include dependency graph for token.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  token
 Struct for a Mya token. More...
 

Typedefs

typedef enum token_type token_type_t
 Enumeration of token types.
 
typedef struct token token_t
 Struct for a Mya token.
 

Enumerations

enum  token_type {
  TK_CLOSE_BRACES ,
  TK_CLOSE_BRACKET ,
  TK_CLOSE_PARENS ,
  TK_COLON ,
  TK_COMMA ,
  TK_EOF ,
  TK_EQUAL ,
  TK_IDENTIFIER ,
  TK_KEYWORD ,
  TK_NUMBER ,
  TK_OPEN_BRACES ,
  TK_OPEN_BRACKET ,
  TK_OPEN_PARENS ,
  TK_OPERATOR ,
  TK_SEMICOLON ,
  TK_STRING
}
 Enumeration of token types. More...
 

Variables

const char * mya_token_types []
 

Typedef Documentation

◆ token_t

typedef struct token token_t

Struct for a Mya token.

◆ token_type_t

typedef enum token_type token_type_t

Enumeration of token types.

Enumeration Type Documentation

◆ token_type

enum token_type

Enumeration of token types.

Enumerator
TK_CLOSE_BRACES 
TK_CLOSE_BRACKET 
TK_CLOSE_PARENS 
TK_COLON 
TK_COMMA 
TK_EOF 
TK_EQUAL 
TK_IDENTIFIER 
TK_KEYWORD 
TK_NUMBER 
TK_OPEN_BRACES 
TK_OPEN_BRACKET 
TK_OPEN_PARENS 
TK_OPERATOR 
TK_SEMICOLON 
TK_STRING 

Definition at line 8 of file token.h.

9{
15 TK_EOF,
enum token_type token_type_t
Enumeration of token types.
@ 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

Variable Documentation

◆ mya_token_types

const char* mya_token_types[]
extern

Definition at line 36 of file globals.c.

36 {
37 [TK_CLOSE_BRACES] = "close_braces",
38 // clang-format hates me.
39 [TK_CLOSE_BRACKET] = "close_bracket",
40 [TK_CLOSE_PARENS] = "close_parentheses",
41 [TK_COLON] = "colon",
42 [TK_COMMA] = "comma",
43 [TK_EOF] = "end_of_file",
44 [TK_EQUAL] = "equal",
45 [TK_IDENTIFIER] = "identifier",
46 [TK_KEYWORD] = "keyword",
47 [TK_NUMBER] = "number",
48 [TK_OPEN_BRACES] = "open_braces",
49 [TK_OPEN_BRACKET] = "open_bracket",
50 [TK_OPEN_PARENS] = "open_parentheses",
51 [TK_OPERATOR] = "operator",
52 [TK_SEMICOLON] = "semicolon",
53 [TK_STRING] = "string",
54 NULL,
55};