| 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 "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Parse top level of a class and register all functions/fields. | 137 // Parse top level of a class and register all functions/fields. |
| 138 static void ParseClass(const Class& cls); | 138 static void ParseClass(const Class& cls); |
| 139 | 139 |
| 140 static void ParseFunction(ParsedFunction* parsed_function); | 140 static void ParseFunction(ParsedFunction* parsed_function); |
| 141 | 141 |
| 142 // Parse and evaluate the metadata expressions at token_pos in the | 142 // Parse and evaluate the metadata expressions at token_pos in the |
| 143 // class namespace of class cls (which can be the implicit toplevel | 143 // class namespace of class cls (which can be the implicit toplevel |
| 144 // class if the metadata is at the top-level). | 144 // class if the metadata is at the top-level). |
| 145 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); | 145 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); |
| 146 | 146 |
| 147 // Parse a function func and retrieve parameter information that can not be |
| 148 // found in its function object. Returns either an error if the parser fails |
| 149 // (which could be the case for local functions), or a flat array of the size |
| 150 // (2*number_of_parameters). For each parameter i in this array, (2*i) |
| 151 // contains a bool indicating whether the parameter has been final, and |
| 152 // (2*i+1) contains an array of its default values (or null if it has no |
| 153 // default values). |
| 154 static RawObject* ParseFunctionParameters(const Function& func); |
| 155 |
| 147 // Format and print a message with source location. | 156 // Format and print a message with source location. |
| 148 // A null script means no source and a negative token_pos means no position. | 157 // A null script means no source and a negative token_pos means no position. |
| 149 static void PrintMessage(const Script& script, | 158 static void PrintMessage(const Script& script, |
| 150 intptr_t token_pos, | 159 intptr_t token_pos, |
| 151 const char* message_header, | 160 const char* message_header, |
| 152 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 161 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
| 153 | 162 |
| 154 // Build an error object containing a formatted error or warning message. | 163 // Build an error object containing a formatted error or warning message. |
| 155 // A null script means no source and a negative token_pos means no position. | 164 // A null script means no source and a negative token_pos means no position. |
| 156 static RawError* FormatError(const Script& script, | 165 static RawError* FormatError(const Script& script, |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 intptr_t last_used_try_index_; | 706 intptr_t last_used_try_index_; |
| 698 | 707 |
| 699 bool unregister_pending_function_; | 708 bool unregister_pending_function_; |
| 700 | 709 |
| 701 DISALLOW_COPY_AND_ASSIGN(Parser); | 710 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 702 }; | 711 }; |
| 703 | 712 |
| 704 } // namespace dart | 713 } // namespace dart |
| 705 | 714 |
| 706 #endif // VM_PARSER_H_ | 715 #endif // VM_PARSER_H_ |
| OLD | NEW |