Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: vm/token.h

Issue 9203004: - Remove support for ">>>" operator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« vm/scanner.cc ('K') | « vm/scanner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assert.h" 8 #include "vm/assert.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 TOK(kDECR, "--", 0, kNoAttribute) \ 47 TOK(kDECR, "--", 0, kNoAttribute) \
48 \ 48 \
49 /* Assignment operators. */ \ 49 /* Assignment operators. */ \
50 /* Please update IsAssignmentOperator() if you make */ \ 50 /* Please update IsAssignmentOperator() if you make */ \
51 /* any changes to this block. */ \ 51 /* any changes to this block. */ \
52 TOK(kASSIGN, "=", 2, kNoAttribute) \ 52 TOK(kASSIGN, "=", 2, kNoAttribute) \
53 TOK(kASSIGN_OR, "|=", 2, kNoAttribute) \ 53 TOK(kASSIGN_OR, "|=", 2, kNoAttribute) \
54 TOK(kASSIGN_XOR, "^=", 2, kNoAttribute) \ 54 TOK(kASSIGN_XOR, "^=", 2, kNoAttribute) \
55 TOK(kASSIGN_AND, "&=", 2, kNoAttribute) \ 55 TOK(kASSIGN_AND, "&=", 2, kNoAttribute) \
56 TOK(kASSIGN_SHL, "<<=", 2, kNoAttribute) \ 56 TOK(kASSIGN_SHL, "<<=", 2, kNoAttribute) \
57 TOK(kASSIGN_SAR, ">>=", 2, kNoAttribute) \ 57 TOK(kASSIGN_SHR, ">>=", 2, kNoAttribute) \
58 TOK(kASSIGN_SHR, ">>>=", 2, kNoAttribute) \
59 TOK(kASSIGN_ADD, "+=", 2, kNoAttribute) \ 58 TOK(kASSIGN_ADD, "+=", 2, kNoAttribute) \
60 TOK(kASSIGN_SUB, "-=", 2, kNoAttribute) \ 59 TOK(kASSIGN_SUB, "-=", 2, kNoAttribute) \
61 TOK(kASSIGN_MUL, "*=", 2, kNoAttribute) \ 60 TOK(kASSIGN_MUL, "*=", 2, kNoAttribute) \
62 TOK(kASSIGN_TRUNCDIV, "~/=", 2, kNoAttribute) \ 61 TOK(kASSIGN_TRUNCDIV, "~/=", 2, kNoAttribute) \
63 TOK(kASSIGN_DIV, "/=", 2, kNoAttribute) \ 62 TOK(kASSIGN_DIV, "/=", 2, kNoAttribute) \
64 TOK(kASSIGN_MOD, "%=", 2, kNoAttribute) \ 63 TOK(kASSIGN_MOD, "%=", 2, kNoAttribute) \
65 \ 64 \
66 TOK(kCOMMA, ",", 1, kNoAttribute) \ 65 TOK(kCOMMA, ",", 1, kNoAttribute) \
67 TOK(kOR, "||", 4, kNoAttribute) \ 66 TOK(kOR, "||", 4, kNoAttribute) \
68 TOK(kAND, "&&", 5, kNoAttribute) \ 67 TOK(kAND, "&&", 5, kNoAttribute) \
69 TOK(kBIT_OR, "|", 6, kNoAttribute) \ 68 TOK(kBIT_OR, "|", 6, kNoAttribute) \
70 TOK(kBIT_XOR, "^", 7, kNoAttribute) \ 69 TOK(kBIT_XOR, "^", 7, kNoAttribute) \
71 TOK(kBIT_AND, "&", 8, kNoAttribute) \ 70 TOK(kBIT_AND, "&", 8, kNoAttribute) \
72 TOK(kBIT_NOT, "~", 0, kNoAttribute) \ 71 TOK(kBIT_NOT, "~", 0, kNoAttribute) \
73 \ 72 \
74 /* Shift operators. */ \ 73 /* Shift operators. */ \
75 TOK(kSHL, "<<", 11, kNoAttribute) \ 74 TOK(kSHL, "<<", 11, kNoAttribute) \
76 TOK(kSAR, ">>", 11, kNoAttribute) \ 75 TOK(kSHR, ">>", 11, kNoAttribute) \
77 TOK(kSHR, ">>>", 11, kNoAttribute) \
78 \ 76 \
79 /* Additive operators. */ \ 77 /* Additive operators. */ \
80 TOK(kADD, "+", 12, kNoAttribute) \ 78 TOK(kADD, "+", 12, kNoAttribute) \
81 TOK(kSUB, "-", 12, kNoAttribute) \ 79 TOK(kSUB, "-", 12, kNoAttribute) \
82 \ 80 \
83 /* Multiplicative operators */ \ 81 /* Multiplicative operators */ \
84 TOK(kMUL, "*", 13, kNoAttribute) \ 82 TOK(kMUL, "*", 13, kNoAttribute) \
85 TOK(kDIV, "/", 13, kNoAttribute) \ 83 TOK(kDIV, "/", 13, kNoAttribute) \
86 TOK(kTRUNCDIV, "~/", 13, kNoAttribute) \ 84 TOK(kTRUNCDIV, "~/", 13, kNoAttribute) \
87 TOK(kMOD, "%", 13, kNoAttribute) \ 85 TOK(kMOD, "%", 13, kNoAttribute) \
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 232
235 static Attribute Attributes(Kind tok) { 233 static Attribute Attributes(Kind tok) {
236 ASSERT(tok < kNumTokens); 234 ASSERT(tok < kNumTokens);
237 return attributes_[tok]; 235 return attributes_[tok];
238 } 236 }
239 237
240 static bool CanBeOverloaded(Kind tok) { 238 static bool CanBeOverloaded(Kind tok) {
241 ASSERT(tok < kNumTokens); 239 ASSERT(tok < kNumTokens);
242 return IsRelationalOperator(tok) || 240 return IsRelationalOperator(tok) ||
243 (tok == kEQ) || 241 (tok == kEQ) ||
244 (tok >= kADD && tok <= kMOD) || 242 (tok >= kADD && tok <= kMOD) || // Arithmetic operations.
245 (tok >= kBIT_OR && tok <= kSHR) || 243 (tok >= kBIT_OR && tok <= kSHR) || // Bit operations.
246 (tok == kINDEX) || 244 (tok == kINDEX) ||
247 (tok == kASSIGN_INDEX) || 245 (tok == kASSIGN_INDEX) ||
248 (tok == kNEGATE) || 246 (tok == kNEGATE);
249 (tok >= kBIT_OR && tok <= kBIT_NOT);
250 } 247 }
251 248
252 private: 249 private:
253 static const char* name_[kNumTokens]; 250 static const char* name_[kNumTokens];
254 static const char* tok_str_[kNumTokens]; 251 static const char* tok_str_[kNumTokens];
255 static const uint8_t precedence_[kNumTokens]; 252 static const uint8_t precedence_[kNumTokens];
256 static const Attribute attributes_[kNumTokens]; 253 static const Attribute attributes_[kNumTokens];
257 }; 254 };
258 255
259 256
260 } // namespace dart 257 } // namespace dart
261 258
262 #endif // VM_TOKEN_H_ 259 #endif // VM_TOKEN_H_
OLDNEW
« vm/scanner.cc ('K') | « vm/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698