libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
token.h File Reference
#include <stdint.h>
#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 10 of file token.h.

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

Variable Documentation

◆ mya_token_types

const char* mya_token_types[]
extern

Definition at line 44 of file globals.c.

44 {
45 [TK_CLOSE_BRACES] = "close_braces",
46 // clang-format hates me.
47 [TK_CLOSE_BRACKET] = "close_bracket",
48 [TK_CLOSE_PARENS] = "close_parentheses",
49 [TK_COLON] = "colon",
50 [TK_COMMA] = "comma",
51 [TK_EOF] = "end_of_file",
52 [TK_EQUAL] = "equal",
53 [TK_IDENTIFIER] = "identifier",
54 [TK_KEYWORD] = "keyword",
55 [TK_NUMBER] = "number",
56 [TK_OPEN_BRACES] = "open_braces",
57 [TK_OPEN_BRACKET] = "open_bracket",
58 [TK_OPEN_PARENS] = "open_parentheses",
59 [TK_OPERATOR] = "operator",
60 [TK_SEMICOLON] = "semicolon",
61 [TK_STRING] = "string",
62 NULL,
63};