aboutsummaryrefslogtreecommitdiff
path: root/src/include/token.h
blob: 4ca83567bfd650d3280f0334690acfbb6d251579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef TOKEN_H
#define TOKEN_H


typedef struct TOKEN_STRUC {
   enum {
      TOKEN_KEYWORD,             // keyword
      TOKEN_STR_DELIM,           // '"'
      TOKEN_STR,                 // "string"
      TOKEN_COMM_DELIM_START,    // '['
      TOKEN_COMM,                // '[comment]'
      TOKEN_COMM_DELIM_END,      // ']'
      TOKEN_DEFINE_CONST,        // '=>'
      TOKEN_DEFINE_MUT,          // '->'
      TOKEN_END,                 // ';'
      TOKEN_LORD,                // '('
      TOKEN_RORD,                // ')'
      TOKEN_DIRECTIVE_DELIM,     // '#'
      TOKEN_DIRECTIVE,           // #DIRECTIVE;
      TOKEN_EOF,                 // '\0'
    } type;

    char* value;
} token_t;

extern token_t* token_init(int type, char* value);


#endif