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 "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 void ComputeCurrentToken(); | 370 void ComputeCurrentToken(); |
371 | 371 |
372 RawLibraryPrefix* ParsePrefix(); | 372 RawLibraryPrefix* ParsePrefix(); |
373 | 373 |
374 Token::Kind LookaheadToken(int num_tokens); | 374 Token::Kind LookaheadToken(int num_tokens); |
375 String* CurrentLiteral() const; | 375 String* CurrentLiteral() const; |
376 RawDouble* CurrentDoubleLiteral() const; | 376 RawDouble* CurrentDoubleLiteral() const; |
377 RawInteger* CurrentIntegerLiteral() const; | 377 RawInteger* CurrentIntegerLiteral() const; |
| 378 RawFraction* CurrentRationalLiteral() const; |
378 | 379 |
379 // Sets parser to given token position in the stream. | 380 // Sets parser to given token position in the stream. |
380 void SetPosition(TokenPosition position); | 381 void SetPosition(TokenPosition position); |
381 | 382 |
382 void ConsumeToken() { | 383 void ConsumeToken() { |
383 // Reset cache and advance the token. | 384 // Reset cache and advance the token. |
384 prev_token_pos_ = tokens_iterator_.CurrentPosition(); | 385 prev_token_pos_ = tokens_iterator_.CurrentPosition(); |
385 token_kind_ = Token::kILLEGAL; | 386 token_kind_ = Token::kILLEGAL; |
386 tokens_iterator_.Advance(); | 387 tokens_iterator_.Advance(); |
387 INC_STAT(thread(), num_tokens_consumed, 1); | 388 INC_STAT(thread(), num_tokens_consumed, 1); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 | 967 |
967 intptr_t recursion_counter_; | 968 intptr_t recursion_counter_; |
968 friend class RecursionChecker; | 969 friend class RecursionChecker; |
969 | 970 |
970 DISALLOW_COPY_AND_ASSIGN(Parser); | 971 DISALLOW_COPY_AND_ASSIGN(Parser); |
971 }; | 972 }; |
972 | 973 |
973 } // namespace dart | 974 } // namespace dart |
974 | 975 |
975 #endif // VM_PARSER_H_ | 976 #endif // VM_PARSER_H_ |
OLD | NEW |