| 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_AST_H_ | 5 #ifndef VM_AST_H_ |
| 6 #define VM_AST_H_ | 6 #define VM_AST_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 951 |
| 952 class WhileNode : public AstNode { | 952 class WhileNode : public AstNode { |
| 953 public: | 953 public: |
| 954 WhileNode(intptr_t token_pos, | 954 WhileNode(intptr_t token_pos, |
| 955 SourceLabel* label, | 955 SourceLabel* label, |
| 956 AstNode* condition, | 956 AstNode* condition, |
| 957 SequenceNode* body) | 957 SequenceNode* body) |
| 958 : AstNode(token_pos), | 958 : AstNode(token_pos), |
| 959 label_(label), | 959 label_(label), |
| 960 condition_(condition), | 960 condition_(condition), |
| 961 body_(body) { | 961 body_(body), |
| 962 condition_preamble_(NULL) { |
| 962 ASSERT(label_ != NULL); | 963 ASSERT(label_ != NULL); |
| 963 ASSERT(condition_ != NULL); | 964 ASSERT(condition_ != NULL); |
| 964 ASSERT(body_ != NULL); | 965 ASSERT(body_ != NULL); |
| 965 } | 966 } |
| 966 | 967 |
| 967 SourceLabel* label() const { return label_; } | 968 SourceLabel* label() const { return label_; } |
| 968 AstNode* condition() const { return condition_; } | 969 AstNode* condition() const { return condition_; } |
| 969 SequenceNode* body() const { return body_; } | 970 SequenceNode* body() const { return body_; } |
| 971 SequenceNode* condition_preamble() const { return condition_preamble_; } |
| 972 |
| 973 void set_condition_preamble(SequenceNode* condition_preamble) { |
| 974 condition_preamble_ = condition_preamble; |
| 975 } |
| 970 | 976 |
| 971 virtual void VisitChildren(AstNodeVisitor* visitor) const { | 977 virtual void VisitChildren(AstNodeVisitor* visitor) const { |
| 978 if (condition_preamble() != NULL) { |
| 979 condition_preamble()->Visit(visitor); |
| 980 } |
| 972 condition()->Visit(visitor); | 981 condition()->Visit(visitor); |
| 973 body()->Visit(visitor); | 982 body()->Visit(visitor); |
| 974 } | 983 } |
| 975 | 984 |
| 976 DECLARE_COMMON_NODE_FUNCTIONS(WhileNode); | 985 DECLARE_COMMON_NODE_FUNCTIONS(WhileNode); |
| 977 | 986 |
| 978 private: | 987 private: |
| 979 SourceLabel* label_; | 988 SourceLabel* label_; |
| 980 AstNode* condition_; | 989 AstNode* condition_; |
| 981 SequenceNode* body_; | 990 SequenceNode* body_; |
| 991 SequenceNode* condition_preamble_; |
| 982 | 992 |
| 983 DISALLOW_IMPLICIT_CONSTRUCTORS(WhileNode); | 993 DISALLOW_IMPLICIT_CONSTRUCTORS(WhileNode); |
| 984 }; | 994 }; |
| 985 | 995 |
| 986 | 996 |
| 987 class DoWhileNode : public AstNode { | 997 class DoWhileNode : public AstNode { |
| 988 public: | 998 public: |
| 989 DoWhileNode(intptr_t token_pos, | 999 DoWhileNode(intptr_t token_pos, |
| 990 SourceLabel* label, | 1000 SourceLabel* label, |
| 991 AstNode* condition, | 1001 AstNode* condition, |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 const intptr_t try_index_; | 1908 const intptr_t try_index_; |
| 1899 | 1909 |
| 1900 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1910 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1901 }; | 1911 }; |
| 1902 | 1912 |
| 1903 } // namespace dart | 1913 } // namespace dart |
| 1904 | 1914 |
| 1905 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1915 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1906 | 1916 |
| 1907 #endif // VM_AST_H_ | 1917 #endif // VM_AST_H_ |
| OLD | NEW |