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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 /* Please update IsRelationalOperator() if you make */ \ | 101 /* Please update IsRelationalOperator() if you make */ \ |
102 /* any changes to this block. */ \ | 102 /* any changes to this block. */ \ |
103 TOK(kLT, "<", 10, kNoAttribute) \ | 103 TOK(kLT, "<", 10, kNoAttribute) \ |
104 TOK(kGT, ">", 10, kNoAttribute) \ | 104 TOK(kGT, ">", 10, kNoAttribute) \ |
105 TOK(kLTE, "<=", 10, kNoAttribute) \ | 105 TOK(kLTE, "<=", 10, kNoAttribute) \ |
106 TOK(kGTE, ">=", 10, kNoAttribute) \ | 106 TOK(kGTE, ">=", 10, kNoAttribute) \ |
107 \ | 107 \ |
108 /* Internal token for !(expr is Type) negative type test operator */ \ | 108 /* Internal token for !(expr is Type) negative type test operator */ \ |
109 TOK(kISNOT, "", 10, kNoAttribute) \ | 109 TOK(kISNOT, "", 10, kNoAttribute) \ |
110 \ | 110 \ |
111 /* Internal token for (expr as Type) type cast operator */ \ | |
112 TOK(kAS, "", 10, kNoAttribute) \ | |
113 \ | |
114 TOK(kINDEX, "[]", 0, kNoAttribute) \ | 111 TOK(kINDEX, "[]", 0, kNoAttribute) \ |
115 TOK(kASSIGN_INDEX, "[]=", 0, kNoAttribute) \ | 112 TOK(kASSIGN_INDEX, "[]=", 0, kNoAttribute) \ |
116 TOK(kNEGATE, "unary-", 0, kNoAttribute) \ | 113 TOK(kNEGATE, "unary-", 0, kNoAttribute) \ |
117 \ | 114 \ |
118 TOK(kIDENT, "", 0, kNoAttribute) \ | 115 TOK(kIDENT, "", 0, kNoAttribute) \ |
119 TOK(kSTRING, "", 0, kNoAttribute) \ | 116 TOK(kSTRING, "", 0, kNoAttribute) \ |
120 TOK(kINTEGER, "", 0, kNoAttribute) \ | 117 TOK(kINTEGER, "", 0, kNoAttribute) \ |
121 TOK(kDOUBLE, "", 0, kNoAttribute) \ | 118 TOK(kDOUBLE, "", 0, kNoAttribute) \ |
122 \ | 119 \ |
123 TOK(kINTERPOL_VAR, "$", 0, kNoAttribute) \ | 120 TOK(kINTERPOL_VAR, "$", 0, kNoAttribute) \ |
124 TOK(kINTERPOL_START, "${", 0, kNoAttribute) \ | 121 TOK(kINTERPOL_START, "${", 0, kNoAttribute) \ |
125 TOK(kINTERPOL_END, "}", 0, kNoAttribute) \ | 122 TOK(kINTERPOL_END, "}", 0, kNoAttribute) \ |
126 \ | 123 \ |
127 TOK(kAT, "@", 0, kNoAttribute) \ | 124 TOK(kAT, "@", 0, kNoAttribute) \ |
128 \ | 125 \ |
129 TOK(kWHITESP, "", 0, kNoAttribute) \ | 126 TOK(kWHITESP, "", 0, kNoAttribute) \ |
130 TOK(kERROR, "", 0, kNoAttribute) \ | 127 TOK(kERROR, "", 0, kNoAttribute) \ |
131 TOK(kILLEGAL, "", 0, kNoAttribute) \ | 128 TOK(kILLEGAL, "", 0, kNoAttribute) \ |
132 \ | 129 \ |
133 /* Support for Dart scripts. */ \ | 130 /* Support for Dart scripts. */ \ |
134 TOK(kSCRIPTTAG, "#!", 0, kNoAttribute) \ | 131 TOK(kSCRIPTTAG, "#!", 0, kNoAttribute) \ |
135 | 132 |
136 // List of keywords. The list must be alphabetically ordered. The | 133 // List of keywords. The list must be alphabetically ordered. The |
137 // keyword recognition code depends on the ordering. | 134 // keyword recognition code depends on the ordering. |
138 // If you add a keyword at the beginning or end of this list, make sure | 135 // If you add a keyword at the beginning or end of this list, make sure |
139 // to update kFirstKeyword and kLastKeyword below. | 136 // to update kFirstKeyword and kLastKeyword below. |
140 #define DART_KEYWORD_LIST(KW) \ | 137 #define DART_KEYWORD_LIST(KW) \ |
141 KW(kABSTRACT, "abstract", 0, kPseudoKeyword) /* == kFirstKeyword */ \ | 138 KW(kABSTRACT, "abstract", 0, kPseudoKeyword) /* == kFirstKeyword */ \ |
142 KW(kASSERT, "assert", 0, kKeyword) \ | 139 KW(kAS, "as", 10, kPseudoKeyword) \ |
| 140 KW(kASSERT, "assert", 10, kKeyword) \ |
143 KW(kBREAK, "break", 0, kKeyword) \ | 141 KW(kBREAK, "break", 0, kKeyword) \ |
144 KW(kCASE, "case", 0, kKeyword) \ | 142 KW(kCASE, "case", 0, kKeyword) \ |
145 KW(kCATCH, "catch", 0, kKeyword) \ | 143 KW(kCATCH, "catch", 0, kKeyword) \ |
146 KW(kCLASS, "class", 0, kKeyword) \ | 144 KW(kCLASS, "class", 0, kKeyword) \ |
147 KW(kCONST, "const", 0, kKeyword) \ | 145 KW(kCONST, "const", 0, kKeyword) \ |
148 KW(kCONTINUE, "continue", 0, kKeyword) \ | 146 KW(kCONTINUE, "continue", 0, kKeyword) \ |
149 KW(kDEFAULT, "default", 0, kKeyword) \ | 147 KW(kDEFAULT, "default", 0, kKeyword) \ |
150 KW(kDO, "do", 0, kKeyword) \ | 148 KW(kDO, "do", 0, kKeyword) \ |
151 KW(kELSE, "else", 0, kKeyword) \ | 149 KW(kELSE, "else", 0, kKeyword) \ |
152 KW(kEXPORT, "export", 0, kPseudoKeyword) \ | 150 KW(kEXPORT, "export", 0, kPseudoKeyword) \ |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 static const char* name_[]; | 309 static const char* name_[]; |
312 static const char* tok_str_[]; | 310 static const char* tok_str_[]; |
313 static const uint8_t precedence_[]; | 311 static const uint8_t precedence_[]; |
314 static const Attribute attributes_[]; | 312 static const Attribute attributes_[]; |
315 }; | 313 }; |
316 | 314 |
317 | 315 |
318 } // namespace dart | 316 } // namespace dart |
319 | 317 |
320 #endif // VM_TOKEN_H_ | 318 #endif // VM_TOKEN_H_ |
OLD | NEW |