| 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 RUNTIME_VM_PARSER_H_ | 5 #ifndef RUNTIME_VM_PARSER_H_ |
| 6 #define RUNTIME_VM_PARSER_H_ | 6 #define RUNTIME_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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // Parse the top level of a whole script file and register declared classes | 267 // Parse the top level of a whole script file and register declared classes |
| 268 // in the given library. | 268 // in the given library. |
| 269 static void ParseCompilationUnit(const Library& library, | 269 static void ParseCompilationUnit(const Library& library, |
| 270 const Script& script); | 270 const Script& script); |
| 271 | 271 |
| 272 // Parse top level of a class and register all functions/fields. | 272 // Parse top level of a class and register all functions/fields. |
| 273 static void ParseClass(const Class& cls); | 273 static void ParseClass(const Class& cls); |
| 274 | 274 |
| 275 static void ParseFunction(ParsedFunction* parsed_function); | 275 static void ParseFunction(ParsedFunction* parsed_function); |
| 276 | 276 |
| 277 // Return true if |field| has a function literal initializer. |
| 278 // When true is returned, |start| and |end| will hold the token |
| 279 // range of the function literal. |
| 280 static bool FieldHasFunctionLiteralInitializer(const Field& field, |
| 281 TokenPosition* start, |
| 282 TokenPosition* end); |
| 283 |
| 277 // Parse and evaluate the metadata expressions at token_pos in the | 284 // Parse and evaluate the metadata expressions at token_pos in the |
| 278 // class namespace of class cls (which can be the implicit toplevel | 285 // class namespace of class cls (which can be the implicit toplevel |
| 279 // class if the metadata is at the top-level). | 286 // class if the metadata is at the top-level). |
| 280 static RawObject* ParseMetadata(const Field& meta_data); | 287 static RawObject* ParseMetadata(const Field& meta_data); |
| 281 | 288 |
| 282 // Build a function containing the initializer expression of the | 289 // Build a function containing the initializer expression of the |
| 283 // given static field. | 290 // given static field. |
| 284 static ParsedFunction* ParseStaticFieldInitializer(const Field& field); | 291 static ParsedFunction* ParseStaticFieldInitializer(const Field& field); |
| 285 | 292 |
| 286 static void InsertCachedConstantValue(const Script& script, | 293 static void InsertCachedConstantValue(const Script& script, |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 AstNode* GenerateStaticFieldLookup(const Field& field, | 858 AstNode* GenerateStaticFieldLookup(const Field& field, |
| 852 TokenPosition ident_pos); | 859 TokenPosition ident_pos); |
| 853 AstNode* GenerateStaticFieldAccess(const Class& cls, | 860 AstNode* GenerateStaticFieldAccess(const Class& cls, |
| 854 const String& field_name, | 861 const String& field_name, |
| 855 TokenPosition ident_pos); | 862 TokenPosition ident_pos); |
| 856 | 863 |
| 857 LocalVariable* LookupLocalScope(const String& ident); | 864 LocalVariable* LookupLocalScope(const String& ident); |
| 858 void CheckInstanceFieldAccess(TokenPosition field_pos, | 865 void CheckInstanceFieldAccess(TokenPosition field_pos, |
| 859 const String& field_name); | 866 const String& field_name); |
| 860 bool ParsingStaticMember() const; | 867 bool ParsingStaticMember() const; |
| 868 bool GetFunctionLiteralInitializerRange(const Field& field, |
| 869 TokenPosition* start, |
| 870 TokenPosition* end); |
| 861 const AbstractType* ReceiverType(const Class& cls); | 871 const AbstractType* ReceiverType(const Class& cls); |
| 862 bool IsInstantiatorRequired() const; | 872 bool IsInstantiatorRequired() const; |
| 863 bool InGenericFunctionScope() const; | 873 bool InGenericFunctionScope() const; |
| 864 bool ResolveIdentInLocalScope(TokenPosition ident_pos, | 874 bool ResolveIdentInLocalScope(TokenPosition ident_pos, |
| 865 const String& ident, | 875 const String& ident, |
| 866 AstNode** node, | 876 AstNode** node, |
| 867 intptr_t* function_level); | 877 intptr_t* function_level); |
| 868 static const bool kResolveLocally = true; | 878 static const bool kResolveLocally = true; |
| 869 static const bool kResolveIncludingImports = false; | 879 static const bool kResolveIncludingImports = false; |
| 870 | 880 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 | 1021 |
| 1012 intptr_t recursion_counter_; | 1022 intptr_t recursion_counter_; |
| 1013 friend class RecursionChecker; | 1023 friend class RecursionChecker; |
| 1014 | 1024 |
| 1015 DISALLOW_COPY_AND_ASSIGN(Parser); | 1025 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 1016 }; | 1026 }; |
| 1017 | 1027 |
| 1018 } // namespace dart | 1028 } // namespace dart |
| 1019 | 1029 |
| 1020 #endif // RUNTIME_VM_PARSER_H_ | 1030 #endif // RUNTIME_VM_PARSER_H_ |
| OLD | NEW |