| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Parser(const Script& script, const Library& library); | 138 Parser(const Script& script, const Library& library); |
| 139 Parser(const Script& script, const Function& function, intptr_t token_pos); | 139 Parser(const Script& script, const Function& function, intptr_t token_pos); |
| 140 | 140 |
| 141 // Parse the top level of a whole script file and register declared classes | 141 // Parse the top level of a whole script file and register declared classes |
| 142 // and interfaces in the given library. | 142 // and interfaces in the given library. |
| 143 static void ParseCompilationUnit(const Library& library, | 143 static void ParseCompilationUnit(const Library& library, |
| 144 const Script& script); | 144 const Script& script); |
| 145 | 145 |
| 146 static void ParseFunction(ParsedFunction* parsed_function); | 146 static void ParseFunction(ParsedFunction* parsed_function); |
| 147 | 147 |
| 148 // Format and print a message with source location. |
| 149 // A null script means no source and a negative token_pos means no position. |
| 150 static void PrintMessage(const Script& script, |
| 151 intptr_t token_pos, |
| 152 const char* message_header, |
| 153 const char* format, ...); |
| 154 |
| 148 // Build an error object containing a formatted error or warning message. | 155 // Build an error object containing a formatted error or warning message. |
| 149 // A null script means no source and a negative token_pos means no position. | 156 // A null script means no source and a negative token_pos means no position. |
| 150 static RawError* FormatError(const Script& script, | 157 static RawError* FormatError(const Script& script, |
| 151 intptr_t token_pos, | 158 intptr_t token_pos, |
| 152 const char* message_header, | 159 const char* message_header, |
| 153 const char* format, | 160 const char* format, |
| 154 va_list args); | 161 va_list args); |
| 155 | 162 |
| 156 // Same as FormatError, but appends the new error to the 'prev_error'. | 163 // Same as FormatError, but appends the new error to the 'prev_error'. |
| 157 static RawError* FormatErrorWithAppend(const Error& prev_error, | 164 static RawError* FormatErrorWithAppend(const Error& prev_error, |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 576 |
| 570 // Allocate temporary only once per function. | 577 // Allocate temporary only once per function. |
| 571 LocalVariable* expression_temp_; | 578 LocalVariable* expression_temp_; |
| 572 | 579 |
| 573 DISALLOW_COPY_AND_ASSIGN(Parser); | 580 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 574 }; | 581 }; |
| 575 | 582 |
| 576 } // namespace dart | 583 } // namespace dart |
| 577 | 584 |
| 578 #endif // VM_PARSER_H_ | 585 #endif // VM_PARSER_H_ |
| OLD | NEW |