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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // nesting. The function level is zero while parsing the body of the | 170 // nesting. The function level is zero while parsing the body of the |
171 // current_function(), but is greater than zero while parsing the body of | 171 // current_function(), but is greater than zero while parsing the body of |
172 // local functions nested in current_function(). | 172 // local functions nested in current_function(). |
173 | 173 |
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::kScript) || | 180 return (script_.kind() == RawScript::kScriptTag) || |
181 (script_.kind() == RawScript::kLibrary); | 181 (script_.kind() == RawScript::kLibraryTag); |
182 } | 182 } |
183 | 183 |
184 intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); } | 184 intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); } |
185 inline Token::Kind CurrentToken(); | 185 inline Token::Kind CurrentToken(); |
186 Token::Kind LookaheadToken(int num_tokens); | 186 Token::Kind LookaheadToken(int num_tokens); |
187 String* CurrentLiteral() const; | 187 String* CurrentLiteral() const; |
188 RawDouble* CurrentDoubleLiteral() const; | 188 RawDouble* CurrentDoubleLiteral() const; |
189 RawInteger* CurrentIntegerLiteral() const; | 189 RawInteger* CurrentIntegerLiteral() const; |
190 | 190 |
191 // Sets parser to given token position in the stream. | 191 // Sets parser to given token position in the stream. |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 548 |
549 // Allocate temporary only once per function. | 549 // Allocate temporary only once per function. |
550 LocalVariable* expression_temp_; | 550 LocalVariable* expression_temp_; |
551 | 551 |
552 DISALLOW_COPY_AND_ASSIGN(Parser); | 552 DISALLOW_COPY_AND_ASSIGN(Parser); |
553 }; | 553 }; |
554 | 554 |
555 } // namespace dart | 555 } // namespace dart |
556 | 556 |
557 #endif // VM_PARSER_H_ | 557 #endif // VM_PARSER_H_ |
OLD | NEW |