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 RUNTIME_VM_TOKEN_H_ | 5 #ifndef RUNTIME_VM_TOKEN_H_ |
6 #define RUNTIME_VM_TOKEN_H_ | 6 #define RUNTIME_VM_TOKEN_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 // Operator precedence table | 13 // Operator precedence table |
14 // | 14 // |
15 // 14 multiplicative * / ~/ % | 15 // 14 multiplicative * / ~/ % |
16 // 13 additive + - | 16 // 13 additive + - |
17 // 12 shift << >> | 17 // 12 shift << >> |
18 // 11 bitwise and & | 18 // 11 bitwise and & |
19 // 10 bitwise xor ^ | 19 // 10 bitwise xor ^ |
20 // 9 bitwise or | | 20 // 9 bitwise or | |
21 // 8 relational >= > <= < is as | 21 // 8 relational >= > <= < is as |
22 // 7 equality == != === !== | 22 // 7 equality == != === !== |
23 // 6 logical and && | 23 // 6 logical and && |
24 // 5 logical or || | 24 // 5 logical or || |
25 // 4 null check ?? | 25 // 4 null check ?? |
26 // 3 conditional ? | 26 // 3 conditional ? |
27 // 2 assignment = *= /= ~/= %= += -= <<= >>= &= ^= |= ??= | 27 // 2 assignment = *= /= ~/= %= += -= <<= >>= &= ^= |= ??= |
28 // 1 comma , | 28 // 1 comma , |
29 | 29 |
30 | |
31 // Token definitions. | 30 // Token definitions. |
32 // Some operator tokens appear in blocks, e.g. assignment operators. | 31 // Some operator tokens appear in blocks, e.g. assignment operators. |
33 // There is code that depends on the values within a block to be | 32 // There is code that depends on the values within a block to be |
34 // contiguous, and on the order of values. | 33 // contiguous, and on the order of values. |
35 #define DART_TOKEN_LIST(TOK) \ | 34 #define DART_TOKEN_LIST(TOK) \ |
36 TOK(kEOS, "", 0, kNoAttribute) \ | 35 TOK(kEOS, "", 0, kNoAttribute) \ |
37 \ | 36 \ |
38 TOK(kLPAREN, "(", 0, kNoAttribute) \ | 37 TOK(kLPAREN, "(", 0, kNoAttribute) \ |
39 TOK(kRPAREN, ")", 0, kNoAttribute) \ | 38 TOK(kRPAREN, ")", 0, kNoAttribute) \ |
40 TOK(kLBRACK, "[", 0, kNoAttribute) \ | 39 TOK(kLBRACK, "[", 0, kNoAttribute) \ |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 private: | 324 private: |
326 static const char* name_[]; | 325 static const char* name_[]; |
327 static const char* tok_str_[]; | 326 static const char* tok_str_[]; |
328 static const uint8_t precedence_[]; | 327 static const uint8_t precedence_[]; |
329 static const Attribute attributes_[]; | 328 static const Attribute attributes_[]; |
330 }; | 329 }; |
331 | 330 |
332 } // namespace dart | 331 } // namespace dart |
333 | 332 |
334 #endif // RUNTIME_VM_TOKEN_H_ | 333 #endif // RUNTIME_VM_TOKEN_H_ |
OLD | NEW |