| 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 LocalVariable* saved_stack_trace_var); | 611 LocalVariable* saved_stack_trace_var); |
| 612 // Parse all the catch clause of a try. | 612 // Parse all the catch clause of a try. |
| 613 SequenceNode* ParseCatchClauses(intptr_t handler_pos, | 613 SequenceNode* ParseCatchClauses(intptr_t handler_pos, |
| 614 bool is_async, | 614 bool is_async, |
| 615 LocalVariable* exception_var, | 615 LocalVariable* exception_var, |
| 616 LocalVariable* stack_trace_var, | 616 LocalVariable* stack_trace_var, |
| 617 LocalVariable* rethrow_exception_var, | 617 LocalVariable* rethrow_exception_var, |
| 618 LocalVariable* rethrow_stack_trace_var, | 618 LocalVariable* rethrow_stack_trace_var, |
| 619 const GrowableObjectArray& handler_types, | 619 const GrowableObjectArray& handler_types, |
| 620 bool* needs_stack_trace); | 620 bool* needs_stack_trace); |
| 621 // Parse finally block and create an AST for it. | 621 // Parse or generate a finally clause. |
| 622 SequenceNode* ParseFinallyBlock(bool is_async, | 622 SequenceNode* EnsureFinallyClause(bool parse, |
| 623 LocalVariable* exception_var, | 623 bool is_async, |
| 624 LocalVariable* stack_trace_var, | 624 LocalVariable* exception_var, |
| 625 LocalVariable* rethrow_exception_var, | 625 LocalVariable* stack_trace_var, |
| 626 LocalVariable* rethrow_stack_trace_var); | 626 LocalVariable* rethrow_exception_var, |
| 627 LocalVariable* rethrow_stack_trace_var); |
| 627 // Push try block onto the stack of try blocks in scope. | 628 // Push try block onto the stack of try blocks in scope. |
| 628 void PushTry(Block* try_block); | 629 void PushTry(Block* try_block); |
| 629 // Pop the inner most try block from the stack. | 630 // Pop the inner most try block from the stack. |
| 630 TryStack* PopTry(); | 631 TryStack* PopTry(); |
| 631 // Collect saved try context variables if await or yield is in try block. | 632 // Collect saved try context variables if await or yield is in try block. |
| 632 void CheckAsyncOpInTryBlock( | 633 void CheckAsyncOpInTryBlock( |
| 633 LocalVariable** saved_try_ctx, | 634 LocalVariable** saved_try_ctx, |
| 634 LocalVariable** async_saved_try_ctx, | 635 LocalVariable** async_saved_try_ctx, |
| 635 LocalVariable** outer_saved_try_ctx, | 636 LocalVariable** outer_saved_try_ctx, |
| 636 LocalVariable** outer_async_saved_try_ctx) const; | 637 LocalVariable** outer_async_saved_try_ctx) const; |
| 637 // Add specified node to try block list so that it can be patched with | 638 // Add specified node to try block list so that it can be patched with |
| 638 // inlined finally code if needed. | 639 // inlined finally code if needed. |
| 639 void AddNodeForFinallyInlining(AstNode* node); | 640 void AddNodeForFinallyInlining(AstNode* node); |
| 640 // Add the inlined finally block to the specified node. | 641 // Add the inlined finally clause to the specified node. |
| 641 void AddFinallyBlockToNode(bool is_async, | 642 void AddFinallyClauseToNode(bool is_async, |
| 642 AstNode* node, | 643 AstNode* node, |
| 643 InlinedFinallyNode* finally_node); | 644 InlinedFinallyNode* finally_clause); |
| 644 AstNode* ParseTryStatement(String* label_name); | 645 AstNode* ParseTryStatement(String* label_name); |
| 645 RawAbstractType* ParseConstFinalVarOrType( | 646 RawAbstractType* ParseConstFinalVarOrType( |
| 646 ClassFinalizer::FinalizationKind finalization); | 647 ClassFinalizer::FinalizationKind finalization); |
| 647 AstNode* ParseVariableDeclaration(const AbstractType& type, | 648 AstNode* ParseVariableDeclaration(const AbstractType& type, |
| 648 bool is_final, | 649 bool is_final, |
| 649 bool is_const, | 650 bool is_const, |
| 650 SequenceNode** await_preamble); | 651 SequenceNode** await_preamble); |
| 651 AstNode* ParseVariableDeclarationList(); | 652 AstNode* ParseVariableDeclarationList(); |
| 652 AstNode* ParseFunctionStatement(bool is_literal); | 653 AstNode* ParseFunctionStatement(bool is_literal); |
| 653 AstNode* ParseYieldStatement(); | 654 AstNode* ParseYieldStatement(); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 | 858 |
| 858 // Indentation of parser trace. | 859 // Indentation of parser trace. |
| 859 intptr_t trace_indent_; | 860 intptr_t trace_indent_; |
| 860 | 861 |
| 861 DISALLOW_COPY_AND_ASSIGN(Parser); | 862 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 862 }; | 863 }; |
| 863 | 864 |
| 864 } // namespace dart | 865 } // namespace dart |
| 865 | 866 |
| 866 #endif // VM_PARSER_H_ | 867 #endif // VM_PARSER_H_ |
| OLD | NEW |