| 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 "vm/ast.h" | 10 #include "vm/ast.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // The class or interface being parsed. | 174 // The class or interface being parsed. |
| 175 const Class& current_class() const; | 175 const Class& current_class() const; |
| 176 void set_current_class(const Class& value); | 176 void set_current_class(const Class& value); |
| 177 | 177 |
| 178 // Parsing a library or a regular source script. | 178 // Parsing a library or a regular source script. |
| 179 bool is_library_source() const { | 179 bool is_library_source() const { |
| 180 return (script_.kind() == RawScript::kScriptTag) || | 180 return (script_.kind() == RawScript::kScriptTag) || |
| 181 (script_.kind() == RawScript::kLibraryTag); | 181 (script_.kind() == RawScript::kLibraryTag); |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Parsing library patch script. |
| 185 bool is_patch_source() const { |
| 186 return script_.kind() == RawScript::kPatchTag; |
| 187 } |
| 188 |
| 184 intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); } | 189 intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); } |
| 185 inline Token::Kind CurrentToken(); | 190 inline Token::Kind CurrentToken(); |
| 186 Token::Kind LookaheadToken(int num_tokens); | 191 Token::Kind LookaheadToken(int num_tokens); |
| 187 String* CurrentLiteral() const; | 192 String* CurrentLiteral() const; |
| 188 RawDouble* CurrentDoubleLiteral() const; | 193 RawDouble* CurrentDoubleLiteral() const; |
| 189 RawInteger* CurrentIntegerLiteral() const; | 194 RawInteger* CurrentIntegerLiteral() const; |
| 190 | 195 |
| 191 // Sets parser to given token position in the stream. | 196 // Sets parser to given token position in the stream. |
| 192 void SetPosition(intptr_t position); | 197 void SetPosition(intptr_t position); |
| 193 | 198 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 570 |
| 566 // Allocate temporary only once per function. | 571 // Allocate temporary only once per function. |
| 567 LocalVariable* expression_temp_; | 572 LocalVariable* expression_temp_; |
| 568 | 573 |
| 569 DISALLOW_COPY_AND_ASSIGN(Parser); | 574 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 570 }; | 575 }; |
| 571 | 576 |
| 572 } // namespace dart | 577 } // namespace dart |
| 573 | 578 |
| 574 #endif // VM_PARSER_H_ | 579 #endif // VM_PARSER_H_ |
| OLD | NEW |