comparison lwcc/token.h @ 306:b08787e5b9f3 ccdev

Add include search paths and command line macro definitions Added command line macro definitions. Also implemented include paths. There is no default include path; that will be supplied by the driver program.
author William Astle <lost@l-w.ca>
date Wed, 18 Sep 2013 20:41:41 -0600
parents 54f213c8fb81
children
comparison
equal deleted inserted replaced
305:54f213c8fb81 306:b08787e5b9f3
29 CPP_NOUNG = -3, 29 CPP_NOUNG = -3,
30 CPP_EOL = -2, 30 CPP_EOL = -2,
31 CPP_EOF = -1, 31 CPP_EOF = -1,
32 }; 32 };
33 33
34 enum 34 #define TOK_NONE 0
35 { 35 #define TOK_EOF 1
36 TOK_NONE = 0, 36 #define TOK_EOL 2
37 TOK_EOF, 37 #define TOK_WSPACE 3
38 TOK_EOL, 38 #define TOK_IDENT 4
39 TOK_WSPACE, 39 #define TOK_NUMBER 5
40 TOK_IDENT, 40 #define TOK_CHAR 6
41 TOK_NUMBER, 41 #define TOK_ADD 8
42 // TOK_STRING, 42 #define TOK_SUB 9
43 TOK_CHAR, 43 #define TOK_OPAREN 10
44 TOK_DIV, 44 #define TOK_CPAREN 11
45 TOK_ADD, 45 #define TOK_NE 12
46 TOK_SUB, 46 #define TOK_EQ 13
47 TOK_OPAREN, 47 #define TOK_LE 14
48 TOK_CPAREN, 48 #define TOK_LT 15
49 TOK_NE, 49 #define TOK_GE 16
50 TOK_EQ, 50 #define TOK_GT 17
51 TOK_LE, 51 #define TOK_BAND 18
52 TOK_LT, 52 #define TOK_BOR 19
53 TOK_GE, 53 #define TOK_BNOT 20
54 TOK_GT, 54 #define TOK_MOD 21
55 TOK_BAND, 55 #define TOK_COMMA 22
56 TOK_BOR, 56 #define TOK_ELLIPSIS 23
57 TOK_BNOT, 57 #define TOK_QMARK 24
58 TOK_MOD, 58 #define TOK_COLON 25
59 TOK_COMMA, 59 #define TOK_OBRACE 26
60 TOK_ELLIPSIS, 60 #define TOK_CBRACE 27
61 TOK_QMARK, 61 #define TOK_OSQUARE 28
62 TOK_COLON, 62 #define TOK_CSQUARE 29
63 TOK_OBRACE, 63 #define TOK_COM 30
64 TOK_CBRACE, 64 #define TOK_EOS 31
65 TOK_OSQUARE, 65 #define TOK_HASH 32
66 TOK_CSQUARE, 66 #define TOK_DBLHASH 33
67 TOK_COM, 67 #define TOK_XOR 34
68 TOK_EOS, 68 #define TOK_XORASS 35
69 TOK_HASH, 69 #define TOK_STAR 36
70 TOK_DBLHASH, 70 #define TOK_MULASS 37
71 TOK_XOR, 71 #define TOK_DIV 38
72 TOK_XORASS, 72 #define TOK_DIVASS 39
73 TOK_STAR, 73 #define TOK_ASS 40
74 TOK_MULASS, 74 #define TOK_MODASS 41
75 TOK_DIVASS, 75 #define TOK_SUBASS 42
76 TOK_ASS, 76 #define TOK_DBLSUB 43
77 TOK_MODASS, 77 #define TOK_ADDASS 44
78 TOK_SUBASS, 78 #define TOK_DBLADD 45
79 TOK_DBLSUB, 79 #define TOK_BWAND 46
80 TOK_ADDASS, 80 #define TOK_BWANDASS 47
81 TOK_DBLADD, 81 #define TOK_BWOR 48
82 TOK_BWAND, 82 #define TOK_BWORASS 49
83 TOK_BWANDASS, 83 #define TOK_LSH 50
84 TOK_BWOR, 84 #define TOK_LSHASS 51
85 TOK_BWORASS, 85 #define TOK_RSH 52
86 TOK_LSH, 86 #define TOK_RSHASS 53
87 TOK_LSHASS, 87 #define TOK_DOT 54
88 TOK_RSH, 88 #define TOK_CHR_LIT 55
89 TOK_RSHASS, 89 #define TOK_STR_LIT 56
90 TOK_DOT, 90 #define TOK_ARROW 57
91 TOK_CHR_LIT, 91 #define TOK_ENDEXPAND 58
92 TOK_STR_LIT, 92 #define TOK_ERROR 59
93 TOK_ARROW, 93 #define TOK_MAX 60
94 TOK_ENDEXPAND,
95 TOK_STARTEXPAND,
96 TOK_ERROR,
97 TOK_MAX
98 };
99 94
100 struct token 95 struct token
101 { 96 {
102 int ttype; // token type 97 int ttype; // token type
103 char *strval; // the token value if relevant 98 char *strval; // the token value if relevant