Mercurial > projects > dil
comparison trunk/src/dil/Token.d @ 343:95f1b6e43214
- Removed TOK.Special and added an own entry for each special token.
- Added method finalizeSpecialToken() which assigns a token a value according to its semantics.
- Added VENDOR constant.
author | aziz |
---|---|
date | Thu, 23 Aug 2007 14:10:04 +0000 |
parents | 4a7359b88c11 |
children | 511c14950cac |
comparison
equal
deleted
inserted
replaced
342:f13d551d7c4f | 343:95f1b6e43214 |
---|---|
23 HashLine = 3 | Whitespace, | 23 HashLine = 3 | Whitespace, |
24 Filespec = 4 | Whitespace, | 24 Filespec = 4 | Whitespace, |
25 | 25 |
26 Identifier = 5, | 26 Identifier = 5, |
27 String, | 27 String, |
28 Special, | |
29 CharLiteral, WCharLiteral, DCharLiteral, | 28 CharLiteral, WCharLiteral, DCharLiteral, |
29 | |
30 // Special tokens | |
31 FILE, | |
32 LINE, | |
33 DATE, | |
34 TIME, | |
35 TIMESTAMP, | |
36 VENDOR, | |
37 VERSION, | |
30 | 38 |
31 // Numbers | 39 // Numbers |
32 Int32, Int64, Uint32, Uint64, | 40 Int32, Int64, Uint32, Uint64, |
33 // Floating point number scanner relies on this order. (FloatXY + 3 == ImaginaryXY) | 41 // Floating point number scanner relies on this order. (FloatXY + 3 == ImaginaryXY) |
34 Float32, Float64, Float80, | 42 Float32, Float64, Float80, |
158 bool isWhitespace() | 166 bool isWhitespace() |
159 { | 167 { |
160 return !!(type & TOK.Whitespace); | 168 return !!(type & TOK.Whitespace); |
161 } | 169 } |
162 | 170 |
171 bool isSpecialToken() | |
172 { | |
173 return *start == '_' && type != TOK.Identifier; | |
174 } | |
175 | |
163 int opEquals(TOK type2) | 176 int opEquals(TOK type2) |
164 { | 177 { |
165 return type == type2; | 178 return type == type2; |
166 } | 179 } |
167 | 180 |