| 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" |
| 11 #include "vm/class_finalizer.h" | 11 #include "vm/class_finalizer.h" |
| 12 #include "vm/compiler_stats.h" | 12 #include "vm/compiler_stats.h" |
| 13 #include "vm/scanner.h" | 13 #include "vm/scanner.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 // Forward declarations. | 17 // Forward declarations. |
| 18 class Function; | 18 class Function; |
| 19 class Script; | 19 class Script; |
| 20 class TokenStream; | 20 class TokenStream; |
| 21 | 21 |
| 22 struct TopLevel; | 22 struct TopLevel; |
| 23 struct ClassDesc; | 23 class ClassDesc; |
| 24 struct MemberDesc; | 24 struct MemberDesc; |
| 25 struct ParamList; | 25 struct ParamList; |
| 26 struct QualIdent; | 26 struct QualIdent; |
| 27 struct CatchParamDesc; | 27 struct CatchParamDesc; |
| 28 struct FieldInitExpression; | 28 struct FieldInitExpression; |
| 29 | 29 |
| 30 // The class ParsedFunction holds the result of parsing a function. | 30 // The class ParsedFunction holds the result of parsing a function. |
| 31 class ParsedFunction : public ValueObject { | 31 class ParsedFunction : public ValueObject { |
| 32 public: | 32 public: |
| 33 static const int kFirstLocalSlotIndex = -2; | 33 static const int kFirstLocalSlotIndex = -2; |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 AstNode* rhs); | 537 AstNode* rhs); |
| 538 AstNode* ExpandAssignableOp(intptr_t op_pos, | 538 AstNode* ExpandAssignableOp(intptr_t op_pos, |
| 539 Token::Kind assignment_op, | 539 Token::Kind assignment_op, |
| 540 AstNode* lhs, | 540 AstNode* lhs, |
| 541 AstNode* rhs); | 541 AstNode* rhs); |
| 542 AstNode* PrepareCompoundAssignmentNodes(AstNode** expr); | 542 AstNode* PrepareCompoundAssignmentNodes(AstNode** expr); |
| 543 LocalVariable* CreateTempConstVariable(intptr_t token_pos, const char* s); | 543 LocalVariable* CreateTempConstVariable(intptr_t token_pos, const char* s); |
| 544 | 544 |
| 545 static bool IsAssignableExpr(AstNode* expr); | 545 static bool IsAssignableExpr(AstNode* expr); |
| 546 | 546 |
| 547 static bool IsPrefixOperator(Token::Kind token); | |
| 548 static bool IsIncrementOperator(Token::Kind token); | |
| 549 | |
| 550 static SequenceNode* NodeAsSequenceNode(intptr_t sequence_pos, | 547 static SequenceNode* NodeAsSequenceNode(intptr_t sequence_pos, |
| 551 AstNode* node, | 548 AstNode* node, |
| 552 LocalScope* scope); | 549 LocalScope* scope); |
| 553 | 550 |
| 554 SequenceNode* MakeImplicitConstructor(const Function& func); | 551 SequenceNode* MakeImplicitConstructor(const Function& func); |
| 555 AstNode* MakeStaticCall(const String& cls_name, | 552 AstNode* MakeStaticCall(const String& cls_name, |
| 556 const String& func_name, | 553 const String& func_name, |
| 557 ArgumentListNode* arguments); | 554 ArgumentListNode* arguments); |
| 558 String& Interpolate(ArrayNode* values); | 555 String& Interpolate(ArrayNode* values); |
| 559 AstNode* MakeAssertCall(intptr_t begin, intptr_t end); | 556 AstNode* MakeAssertCall(intptr_t begin, intptr_t end); |
| 560 AstNode* ThrowTypeError(intptr_t type_pos, const AbstractType& type); | 557 AstNode* ThrowTypeError(intptr_t type_pos, const AbstractType& type); |
| 561 AstNode* ThrowNoSuchMethodError(intptr_t call_pos, const String& name); | 558 AstNode* ThrowNoSuchMethodError(intptr_t call_pos, const String& name); |
| 562 | 559 |
| 563 void CheckFunctionIsCallable(intptr_t token_pos, const Function& function); | 560 void CheckFunctionIsCallable(intptr_t token_pos, const Function& function); |
| 564 void CheckOperatorArity(const MemberDesc& member, Token::Kind operator_token); | 561 void CheckOperatorArity(const MemberDesc& member); |
| 565 | 562 |
| 566 const LocalVariable* GetIncrementTempLocal(); | 563 const LocalVariable* GetIncrementTempLocal(); |
| 567 void EnsureExpressionTemp(); | 564 void EnsureExpressionTemp(); |
| 568 AstNode* CreateAssignmentNode(AstNode* original, AstNode* rhs); | 565 AstNode* CreateAssignmentNode(AstNode* original, AstNode* rhs); |
| 569 AstNode* InsertClosureCallNodes(AstNode* condition); | 566 AstNode* InsertClosureCallNodes(AstNode* condition); |
| 570 | 567 |
| 571 ConstructorCallNode* CreateConstructorCallNode( | 568 ConstructorCallNode* CreateConstructorCallNode( |
| 572 intptr_t token_pos, | 569 intptr_t token_pos, |
| 573 const AbstractTypeArguments& type_arguments, | 570 const AbstractTypeArguments& type_arguments, |
| 574 const Function& constructor, | 571 const Function& constructor, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 609 |
| 613 // Allocate temporary only once per function. | 610 // Allocate temporary only once per function. |
| 614 LocalVariable* expression_temp_; | 611 LocalVariable* expression_temp_; |
| 615 | 612 |
| 616 DISALLOW_COPY_AND_ASSIGN(Parser); | 613 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 617 }; | 614 }; |
| 618 | 615 |
| 619 } // namespace dart | 616 } // namespace dart |
| 620 | 617 |
| 621 #endif // VM_PARSER_H_ | 618 #endif // VM_PARSER_H_ |
| OLD | NEW |