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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 }; | 201 }; |
202 | 202 |
203 | 203 |
204 class Parser : public ValueObject { | 204 class Parser : public ValueObject { |
205 public: | 205 public: |
206 // Parse the top level of a whole script file and register declared classes | 206 // Parse the top level of a whole script file and register declared classes |
207 // in the given library. | 207 // in the given library. |
208 static void ParseCompilationUnit(const Library& library, | 208 static void ParseCompilationUnit(const Library& library, |
209 const Script& script); | 209 const Script& script); |
210 | 210 |
| 211 static intptr_t FindLibraryDeclarationPosition(const Library& library, |
| 212 const Script& script); |
| 213 |
211 // Parse top level of a class and register all functions/fields. | 214 // Parse top level of a class and register all functions/fields. |
212 static void ParseClass(const Class& cls); | 215 static void ParseClass(const Class& cls); |
213 | 216 |
214 static void ParseFunction(ParsedFunction* parsed_function); | 217 static void ParseFunction(ParsedFunction* parsed_function); |
215 | 218 |
216 // Parse and evaluate the metadata expressions at token_pos in the | 219 // Parse and evaluate the metadata expressions at token_pos in the |
217 // class namespace of class cls (which can be the implicit toplevel | 220 // class namespace of class cls (which can be the implicit toplevel |
218 // class if the metadata is at the top-level). | 221 // class if the metadata is at the top-level). |
219 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); | 222 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); |
220 | 223 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 RawArray* EvaluateMetadata(); | 435 RawArray* EvaluateMetadata(); |
433 | 436 |
434 RawFunction::AsyncModifier ParseFunctionModifier(); | 437 RawFunction::AsyncModifier ParseFunctionModifier(); |
435 | 438 |
436 // Support for parsing libraries. | 439 // Support for parsing libraries. |
437 RawObject* CallLibraryTagHandler(Dart_LibraryTag tag, | 440 RawObject* CallLibraryTagHandler(Dart_LibraryTag tag, |
438 intptr_t token_pos, | 441 intptr_t token_pos, |
439 const String& url); | 442 const String& url); |
440 void ParseIdentList(GrowableObjectArray* names); | 443 void ParseIdentList(GrowableObjectArray* names); |
441 void ParseLibraryDefinition(); | 444 void ParseLibraryDefinition(); |
| 445 intptr_t GetLibraryDeclarationPosition(); |
442 void ParseLibraryName(); | 446 void ParseLibraryName(); |
443 void ParseLibraryImportExport(intptr_t metadata_pos); | 447 void ParseLibraryImportExport(intptr_t metadata_pos); |
444 void ParseLibraryPart(); | 448 void ParseLibraryPart(); |
445 void ParsePartHeader(); | 449 void ParsePartHeader(); |
446 void ParseLibraryNameObsoleteSyntax(); | 450 void ParseLibraryNameObsoleteSyntax(); |
447 void ParseLibraryImportObsoleteSyntax(); | 451 void ParseLibraryImportObsoleteSyntax(); |
448 void ParseLibraryIncludeObsoleteSyntax(); | 452 void ParseLibraryIncludeObsoleteSyntax(); |
449 | 453 |
450 void ResolveTypeFromClass(const Class& cls, | 454 void ResolveTypeFromClass(const Class& cls, |
451 ClassFinalizer::FinalizationKind finalization, | 455 ClassFinalizer::FinalizationKind finalization, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 bool unregister_pending_function_; | 842 bool unregister_pending_function_; |
839 | 843 |
840 LocalScope* async_temp_scope_; | 844 LocalScope* async_temp_scope_; |
841 | 845 |
842 DISALLOW_COPY_AND_ASSIGN(Parser); | 846 DISALLOW_COPY_AND_ASSIGN(Parser); |
843 }; | 847 }; |
844 | 848 |
845 } // namespace dart | 849 } // namespace dart |
846 | 850 |
847 #endif // VM_PARSER_H_ | 851 #endif // VM_PARSER_H_ |
OLD | NEW |