-
Notifications
You must be signed in to change notification settings - Fork 2
/
enums.h
80 lines (70 loc) · 1.87 KB
/
enums.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Course IFJ @ FIT VUT Brno, 2015
* IFJ15 Interpreter Project
*
* Authors:
* Lukas Osadsky - xosads00
* Pavol Plaskon - xplask00
* Pavel Pospisil - xpospi88
* Matej Postolka - xposto02
*
* Unless otherwise stated, all code is licensed under a
* GNU General Public License v2.0
*
*/
#ifndef ENUMS_H
#define ENUMS_H
#define VECTOR_AUTORESIZE_COEF 2
enum tokens
{
//keywords
TOKEN_AUTO = 0, //0
TOKEN_CIN, //1
TOKEN_COUT, //2
TOKEN_DOUBLE, //3
TOKEN_ELSE, //4
TOKEN_FOR, //5
TOKEN_IF, //6
TOKEN_INT, //7
TOKEN_RETURN, //8
TOKEN_STRING, //9
TOKEN_LENGTH, //10
TOKEN_SUBSTR, //11
TOKEN_CONCAT, //12
TOKEN_FIND, //13
TOKEN_SORT, //14
//built-in functions
TOKEN_BF_LENGTH, //15
TOKEN_BF_SUBSTR, //16
TOKEN_BF_CONCAT, //17
TOKEN_BF_FIND, //18
TOKEN_BF_SORT, //19
//other tokens
TOKEN_IDENTIFIER, //20 //IDENTIFIER, NOT KEYWORD
TOKEN_EOF, //21
TOKEN_STRING_VALUE, //22 // "some text in quotation marks"
TOKEN_INT_VALUE, //23 // some integer
TOKEN_DOUBLE_VALUE, //24 // double value
TOKEN_ASSIGN, //25 // =
TOKEN_SEMICOLON, //26 // ;
TOKEN_COMMA, //27 // ,
TOKEN_COUT_BRACKET, //28 // <<
TOKEN_CIN_BRACKET, //29 // >>
TOKEN_LROUND_BRACKET, //30 // (
TOKEN_RROUND_BRACKET, //31 // )
TOKEN_LCURLY_BRACKET, //32 // {
TOKEN_RCURLY_BRACKET, //33 // }
//math
TOKEN_MUL, //34 // *
TOKEN_DIV, //35 // /
TOKEN_ADD, //36 // +
TOKEN_SUB, //37 // -
//comparing
TOKEN_EQUAL, //38 // ==
TOKEN_NOT_EQUAL, //39 // !=
TOKEN_GREATER, //40 // >
TOKEN_GREATER_EQUAL, //41 // >=
TOKEN_LESS, //42 // <
TOKEN_LESS_EQUAL //43 // <=
};
#endif