OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_GN_PARSE_TREE_H_ | 5 #ifndef TOOLS_GN_PARSE_TREE_H_ |
6 #define TOOLS_GN_PARSE_TREE_H_ | 6 #define TOOLS_GN_PARSE_TREE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 void set_index(scoped_ptr<ParseNode> i) { index_ = i.Pass(); } | 109 void set_index(scoped_ptr<ParseNode> i) { index_ = i.Pass(); } |
110 | 110 |
111 // The member is the identifier on the right hand side of the dot. Will be | 111 // The member is the identifier on the right hand side of the dot. Will be |
112 // null if the index is set. | 112 // null if the index is set. |
113 const IdentifierNode* member() const { return member_.get(); } | 113 const IdentifierNode* member() const { return member_.get(); } |
114 void set_member(scoped_ptr<IdentifierNode> i) { member_ = i.Pass(); } | 114 void set_member(scoped_ptr<IdentifierNode> i) { member_ = i.Pass(); } |
115 | 115 |
116 private: | 116 private: |
117 Value ExecuteArrayAccess(Scope* scope, Err* err) const; | 117 Value ExecuteArrayAccess(Scope* scope, Err* err) const; |
118 Value ExecuteScopeAccess(Scope* scope, Err* err) const; | 118 Value ExecuteScopeAccess(Scope* scope, Err* err) const; |
| 119 // Takes a value known to be a dictionary. |
| 120 Value ExecuteDictAccess(const Value* dict, Err* err) const; |
119 | 121 |
120 Token base_; | 122 Token base_; |
121 | 123 |
122 // Either index or member will be set according to what type of access this | 124 // Either index or member will be set according to what type of access this |
123 // is. | 125 // is. |
124 scoped_ptr<ParseNode> index_; | 126 scoped_ptr<ParseNode> index_; |
125 scoped_ptr<IdentifierNode> member_; | 127 scoped_ptr<IdentifierNode> member_; |
126 | 128 |
127 DISALLOW_COPY_AND_ASSIGN(AccessorNode); | 129 DISALLOW_COPY_AND_ASSIGN(AccessorNode); |
128 }; | 130 }; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 } | 390 } |
389 | 391 |
390 private: | 392 private: |
391 Token op_; | 393 Token op_; |
392 scoped_ptr<ParseNode> operand_; | 394 scoped_ptr<ParseNode> operand_; |
393 | 395 |
394 DISALLOW_COPY_AND_ASSIGN(UnaryOpNode); | 396 DISALLOW_COPY_AND_ASSIGN(UnaryOpNode); |
395 }; | 397 }; |
396 | 398 |
397 #endif // TOOLS_GN_PARSE_TREE_H_ | 399 #endif // TOOLS_GN_PARSE_TREE_H_ |
OLD | NEW |