| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 const String& url); | 211 const String& url); |
| 212 void ParseLibraryDefinition(); | 212 void ParseLibraryDefinition(); |
| 213 void ParseLibraryName(); | 213 void ParseLibraryName(); |
| 214 void ParseLibraryImport(); | 214 void ParseLibraryImport(); |
| 215 void ParseLibraryInclude(); | 215 void ParseLibraryInclude(); |
| 216 | 216 |
| 217 void TryResolveTypeFromClass(intptr_t type_pos, | 217 void TryResolveTypeFromClass(intptr_t type_pos, |
| 218 const Class& cls, | 218 const Class& cls, |
| 219 AbstractType* type); | 219 AbstractType* type); |
| 220 enum TypeResolution { | 220 enum TypeResolution { |
| 221 kIgnore, // Parsed type is ignored and replaced by Dynamic. |
| 221 kDoNotResolve, // Type resolution is postponed. | 222 kDoNotResolve, // Type resolution is postponed. |
| 222 kCanResolve, // Type resolution is optional. | 223 kCanResolve, // Type resolution is optional. |
| 223 kMustResolve // Type resolution is required. | 224 kMustResolve // Type resolution is required. |
| 224 }; | 225 }; |
| 225 RawAbstractType* ParseType(TypeResolution type_resolution); | 226 RawAbstractType* ParseType(TypeResolution type_resolution); |
| 226 void ParseTypeParameters(const Class& cls); | 227 void ParseTypeParameters(const Class& cls); |
| 227 RawAbstractTypeArguments* ParseTypeArguments(TypeResolution type_resolution); | 228 RawAbstractTypeArguments* ParseTypeArguments(TypeResolution type_resolution); |
| 228 void ParseQualIdent(QualIdent* qual_ident); | 229 void ParseQualIdent(QualIdent* qual_ident); |
| 229 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); | 230 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); |
| 230 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); | 231 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // Adds try block to the list of try blocks seen so far. | 312 // Adds try block to the list of try blocks seen so far. |
| 312 void PushTryBlock(Block* try_block); | 313 void PushTryBlock(Block* try_block); |
| 313 // Pops the inner most try block from the list. | 314 // Pops the inner most try block from the list. |
| 314 TryBlocks* PopTryBlock(); | 315 TryBlocks* PopTryBlock(); |
| 315 // Add specified node to try block list so that it can be patched with | 316 // Add specified node to try block list so that it can be patched with |
| 316 // inlined finally code if needed. | 317 // inlined finally code if needed. |
| 317 void AddNodeForFinallyInlining(AstNode* node); | 318 void AddNodeForFinallyInlining(AstNode* node); |
| 318 // Add the inlined finally block to the specified node. | 319 // Add the inlined finally block to the specified node. |
| 319 void AddFinallyBlockToNode(AstNode* node, InlinedFinallyNode* finally_node); | 320 void AddFinallyBlockToNode(AstNode* node, InlinedFinallyNode* finally_node); |
| 320 AstNode* ParseTryStatement(String* label_name); | 321 AstNode* ParseTryStatement(String* label_name); |
| 321 | 322 RawAbstractType* ParseFinalVarOrType(TypeResolution type_resolution); |
| 322 enum TypeSpecification { | |
| 323 kIsOptional, // Type specification is optional. | |
| 324 kIsMandatory // Type specification is mandatory. | |
| 325 }; | |
| 326 RawAbstractType* ParseFinalVarOrType(TypeSpecification type_specification, | |
| 327 TypeResolution type_resolution); | |
| 328 const AbstractType& ParseConstVarOrType(TypeSpecification type_specification); | |
| 329 AstNode* ParseVariableDeclaration(const AbstractType& type, bool is_const); | 323 AstNode* ParseVariableDeclaration(const AbstractType& type, bool is_const); |
| 330 AstNode* ParseVariableDeclarationList(); | 324 AstNode* ParseVariableDeclarationList(); |
| 331 AstNode* ParseFunctionStatement(bool is_literal); | 325 AstNode* ParseFunctionStatement(bool is_literal); |
| 332 AstNode* ParseStatement(); | 326 AstNode* ParseStatement(); |
| 333 SequenceNode* ParseNestedStatement(bool parsing_loop_body, | 327 SequenceNode* ParseNestedStatement(bool parsing_loop_body, |
| 334 SourceLabel* label); | 328 SourceLabel* label); |
| 335 void ParseStatementSequence(); | 329 void ParseStatementSequence(); |
| 336 bool IsIdentifier(); | 330 bool IsIdentifier(); |
| 337 bool IsFunctionTypeAliasName(); | 331 bool IsFunctionTypeAliasName(); |
| 338 bool IsTypeParameter(); | 332 bool IsTypeParameter(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 // code at all points in the try block where an exit from the block is | 454 // code at all points in the try block where an exit from the block is |
| 461 // done using 'return', 'break' or 'continue' statements. | 455 // done using 'return', 'break' or 'continue' statements. |
| 462 TryBlocks* try_blocks_list_; | 456 TryBlocks* try_blocks_list_; |
| 463 | 457 |
| 464 DISALLOW_COPY_AND_ASSIGN(Parser); | 458 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 465 }; | 459 }; |
| 466 | 460 |
| 467 } // namespace dart | 461 } // namespace dart |
| 468 | 462 |
| 469 #endif // VM_PARSER_H_ | 463 #endif // VM_PARSER_H_ |
| OLD | NEW |