| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 RawFunction* GetSuperFunction(intptr_t token_pos, | 502 RawFunction* GetSuperFunction(intptr_t token_pos, |
| 503 const String& name, | 503 const String& name, |
| 504 ArgumentListNode* arguments, | 504 ArgumentListNode* arguments, |
| 505 bool resolve_getter, | 505 bool resolve_getter, |
| 506 bool* is_no_such_method); | 506 bool* is_no_such_method); |
| 507 AstNode* ParseSuperCall(const String& function_name); | 507 AstNode* ParseSuperCall(const String& function_name); |
| 508 AstNode* ParseSuperFieldAccess(const String& field_name, intptr_t field_pos); | 508 AstNode* ParseSuperFieldAccess(const String& field_name, intptr_t field_pos); |
| 509 AstNode* ParseSuperOperator(); | 509 AstNode* ParseSuperOperator(); |
| 510 AstNode* BuildUnarySuperOperator(Token::Kind op, PrimaryNode* super); | 510 AstNode* BuildUnarySuperOperator(Token::Kind op, PrimaryNode* super); |
| 511 | 511 |
| 512 static bool ParseFormalParameters(const Function& func, ParamList* params); |
| 513 |
| 512 static void SetupDefaultsForOptionalParams(const ParamList* params, | 514 static void SetupDefaultsForOptionalParams(const ParamList* params, |
| 513 Array* default_values); | 515 Array* default_values); |
| 514 ClosureNode* CreateImplicitClosureNode(const Function& func, | 516 ClosureNode* CreateImplicitClosureNode(const Function& func, |
| 515 intptr_t token_pos, | 517 intptr_t token_pos, |
| 516 AstNode* receiver); | 518 AstNode* receiver); |
| 517 static void AddFormalParamsToFunction(const ParamList* params, | 519 static void AddFormalParamsToFunction(const ParamList* params, |
| 518 const Function& func); | 520 const Function& func); |
| 519 void AddFormalParamsToScope(const ParamList* params, LocalScope* scope); | 521 void AddFormalParamsToScope(const ParamList* params, LocalScope* scope); |
| 520 | 522 |
| 521 SequenceNode* ParseConstructor(const Function& func, | 523 SequenceNode* ParseConstructor(const Function& func, |
| 522 Array* default_parameter_values); | 524 Array* default_parameter_values); |
| 523 SequenceNode* ParseFunc(const Function& func, | 525 SequenceNode* ParseFunc(const Function& func, |
| 524 Array* default_parameter_values); | 526 Array* default_parameter_values); |
| 525 | 527 |
| 526 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); | 528 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); |
| 527 | 529 |
| 528 SequenceNode* ParseInstanceGetter(const Function& func); | 530 SequenceNode* ParseInstanceGetter(const Function& func); |
| 529 SequenceNode* ParseInstanceSetter(const Function& func); | 531 SequenceNode* ParseInstanceSetter(const Function& func); |
| 530 SequenceNode* ParseStaticFinalGetter(const Function& func); | 532 SequenceNode* ParseStaticFinalGetter(const Function& func); |
| 531 SequenceNode* ParseStaticInitializer(); | 533 SequenceNode* ParseStaticInitializer(); |
| 532 SequenceNode* ParseMethodExtractor(const Function& func); | 534 SequenceNode* ParseMethodExtractor(const Function& func); |
| 533 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, | 535 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, |
| 534 Array* default_values); | 536 Array* default_values); |
| 535 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, | 537 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, |
| 536 Array* default_values); | 538 Array* default_values); |
| 537 SequenceNode* ParseImplicitClosure(const Function& func, | 539 SequenceNode* ParseImplicitClosure(const Function& func, |
| 538 Array* default_values); | 540 Array* default_values); |
| 541 SequenceNode* ParseConstructorClosure(const Function& func, |
| 542 Array* default_values); |
| 539 | 543 |
| 540 void BuildDispatcherScope(const Function& func, | 544 void BuildDispatcherScope(const Function& func, |
| 541 const ArgumentsDescriptor& desc, | 545 const ArgumentsDescriptor& desc, |
| 542 Array* default_values); | 546 Array* default_values); |
| 543 | 547 |
| 544 void EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos); | 548 void EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos); |
| 545 void ChainNewBlock(LocalScope* outer_scope); | 549 void ChainNewBlock(LocalScope* outer_scope); |
| 546 void OpenBlock(); | 550 void OpenBlock(); |
| 547 void OpenLoopBlock(); | 551 void OpenLoopBlock(); |
| 548 void OpenFunctionBlock(const Function& func); | 552 void OpenFunctionBlock(const Function& func); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 AstNode* ParseStringLiteral(bool allow_interpolation); | 704 AstNode* ParseStringLiteral(bool allow_interpolation); |
| 701 String* ParseImportStringLiteral(); | 705 String* ParseImportStringLiteral(); |
| 702 AstNode* ParseCompoundLiteral(); | 706 AstNode* ParseCompoundLiteral(); |
| 703 AstNode* ParseSymbolLiteral(); | 707 AstNode* ParseSymbolLiteral(); |
| 704 AstNode* ParseListLiteral(intptr_t type_pos, | 708 AstNode* ParseListLiteral(intptr_t type_pos, |
| 705 bool is_const, | 709 bool is_const, |
| 706 const TypeArguments& type_arguments); | 710 const TypeArguments& type_arguments); |
| 707 AstNode* ParseMapLiteral(intptr_t type_pos, | 711 AstNode* ParseMapLiteral(intptr_t type_pos, |
| 708 bool is_const, | 712 bool is_const, |
| 709 const TypeArguments& type_arguments); | 713 const TypeArguments& type_arguments); |
| 714 |
| 715 RawFunction* BuildConstructorClosureFunction(const Function& ctr, |
| 716 intptr_t token_pos); |
| 710 AstNode* ParseNewOperator(Token::Kind op_kind); | 717 AstNode* ParseNewOperator(Token::Kind op_kind); |
| 718 void ParseConstructorClosurization(Function* constructor, |
| 719 TypeArguments* type_arguments); |
| 711 | 720 |
| 712 // An implicit argument, if non-null, is prepended to the returned list. | 721 // An implicit argument, if non-null, is prepended to the returned list. |
| 713 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, | 722 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, |
| 714 bool require_const); | 723 bool require_const); |
| 715 AstNode* ParseStaticCall(const Class& cls, | 724 AstNode* ParseStaticCall(const Class& cls, |
| 716 const String& method_name, | 725 const String& method_name, |
| 717 intptr_t ident_pos); | 726 intptr_t ident_pos); |
| 718 AstNode* ParseInstanceCall(AstNode* receiver, | 727 AstNode* ParseInstanceCall(AstNode* receiver, |
| 719 const String& method_name, | 728 const String& method_name, |
| 720 intptr_t ident_pos, | 729 intptr_t ident_pos, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 880 |
| 872 // Indentation of parser trace. | 881 // Indentation of parser trace. |
| 873 intptr_t trace_indent_; | 882 intptr_t trace_indent_; |
| 874 | 883 |
| 875 DISALLOW_COPY_AND_ASSIGN(Parser); | 884 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 876 }; | 885 }; |
| 877 | 886 |
| 878 } // namespace dart | 887 } // namespace dart |
| 879 | 888 |
| 880 #endif // VM_PARSER_H_ | 889 #endif // VM_PARSER_H_ |
| OLD | NEW |