OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_TOKEN_H_ | 5 #ifndef VM_TOKEN_H_ |
6 #define VM_TOKEN_H_ | 6 #define VM_TOKEN_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 #undef T | 201 #undef T |
202 | 202 |
203 enum Attribute { | 203 enum Attribute { |
204 kNoAttribute = 0, | 204 kNoAttribute = 0, |
205 kKeyword = 1 << 0, | 205 kKeyword = 1 << 0, |
206 kPseudoKeyword = 1 << 1, | 206 kPseudoKeyword = 1 << 1, |
207 }; | 207 }; |
208 | 208 |
209 static const Kind kFirstKeyword = kABSTRACT; | 209 static const Kind kFirstKeyword = kABSTRACT; |
210 static const Kind kLastKeyword = kWITH; | 210 static const Kind kLastKeyword = kWITH; |
211 static const int numKeywords = kLastKeyword - kFirstKeyword + 1; | 211 static const int kNumKeywords = kLastKeyword - kFirstKeyword + 1; |
212 | 212 |
213 static bool IsAssignmentOperator(Kind tok) { | 213 static bool IsAssignmentOperator(Kind tok) { |
214 return kASSIGN <= tok && tok <= kASSIGN_MOD; | 214 return kASSIGN <= tok && tok <= kASSIGN_MOD; |
215 } | 215 } |
216 | 216 |
217 static bool IsRelationalOperator(Kind tok) { | 217 static bool IsRelationalOperator(Kind tok) { |
218 return kLT <= tok && tok <= kGTE; | 218 return kLT <= tok && tok <= kGTE; |
219 } | 219 } |
220 | 220 |
221 static bool IsEqualityOperator(Kind tok) { | 221 static bool IsEqualityOperator(Kind tok) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 static const char* name_[]; | 316 static const char* name_[]; |
317 static const char* tok_str_[]; | 317 static const char* tok_str_[]; |
318 static const uint8_t precedence_[]; | 318 static const uint8_t precedence_[]; |
319 static const Attribute attributes_[]; | 319 static const Attribute attributes_[]; |
320 }; | 320 }; |
321 | 321 |
322 | 322 |
323 } // namespace dart | 323 } // namespace dart |
324 | 324 |
325 #endif // VM_TOKEN_H_ | 325 #endif // VM_TOKEN_H_ |
OLD | NEW |