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_PARSER_H_ | 5 #ifndef VM_PARSER_H_ |
6 #define VM_PARSER_H_ | 6 #define VM_PARSER_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // Sets parser to given token position in the stream. | 264 // Sets parser to given token position in the stream. |
265 void SetPosition(intptr_t position); | 265 void SetPosition(intptr_t position); |
266 | 266 |
267 void ConsumeToken() { | 267 void ConsumeToken() { |
268 // Reset cache and advance the token. | 268 // Reset cache and advance the token. |
269 token_kind_ = Token::kILLEGAL; | 269 token_kind_ = Token::kILLEGAL; |
270 tokens_iterator_.Advance(); | 270 tokens_iterator_.Advance(); |
271 CompilerStats::num_tokens_consumed++; | 271 CompilerStats::num_tokens_consumed++; |
272 } | 272 } |
273 void ConsumeRightAngleBracket(); | 273 void ConsumeRightAngleBracket(); |
| 274 void CheckToken(Token::Kind token_expected, const char* msg = NULL); |
274 void ExpectToken(Token::Kind token_expected); | 275 void ExpectToken(Token::Kind token_expected); |
275 void ExpectSemicolon(); | 276 void ExpectSemicolon(); |
276 void UnexpectedToken(); | 277 void UnexpectedToken(); |
277 String* ExpectUserDefinedTypeIdentifier(const char* msg); | 278 String* ExpectUserDefinedTypeIdentifier(const char* msg); |
278 String* ExpectIdentifier(const char* msg); | 279 String* ExpectIdentifier(const char* msg); |
279 bool IsLiteral(const char* literal); | 280 bool IsLiteral(const char* literal); |
280 | 281 |
281 void SkipIf(Token::Kind); | 282 void SkipIf(Token::Kind); |
282 void SkipBlock(); | 283 void SkipBlock(); |
283 intptr_t SkipMetadata(); | 284 intptr_t SkipMetadata(); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 intptr_t last_used_try_index_; | 721 intptr_t last_used_try_index_; |
721 | 722 |
722 bool unregister_pending_function_; | 723 bool unregister_pending_function_; |
723 | 724 |
724 DISALLOW_COPY_AND_ASSIGN(Parser); | 725 DISALLOW_COPY_AND_ASSIGN(Parser); |
725 }; | 726 }; |
726 | 727 |
727 } // namespace dart | 728 } // namespace dart |
728 | 729 |
729 #endif // VM_PARSER_H_ | 730 #endif // VM_PARSER_H_ |
OLD | NEW |