| 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_SCOPES_H_ | 5 #ifndef VM_SCOPES_H_ |
| 6 #define VM_SCOPES_H_ | 6 #define VM_SCOPES_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void set_end_token_pos(intptr_t value) { end_token_pos_ = value; } | 227 void set_end_token_pos(intptr_t value) { end_token_pos_ = value; } |
| 228 | 228 |
| 229 // The number of variables allocated in the context and belonging to this | 229 // The number of variables allocated in the context and belonging to this |
| 230 // scope and to its children at the same loop level. | 230 // scope and to its children at the same loop level. |
| 231 int num_context_variables() const { return num_context_variables_; } | 231 int num_context_variables() const { return num_context_variables_; } |
| 232 | 232 |
| 233 // Add a variable to the scope. Returns false if a variable with the | 233 // Add a variable to the scope. Returns false if a variable with the |
| 234 // same name is already present. | 234 // same name is already present. |
| 235 bool AddVariable(LocalVariable* variable); | 235 bool AddVariable(LocalVariable* variable); |
| 236 | 236 |
| 237 // Insert a formal parameter variable to the scope at the given position, |
| 238 // possibly in front of aliases already added with AddVariable. |
| 239 // Returns false if a variable with the same name is already present. |
| 240 bool InsertParameterAt(intptr_t pos, LocalVariable* parameter); |
| 241 |
| 237 // Add a label to the scope. Returns false if a label with the same name | 242 // Add a label to the scope. Returns false if a label with the same name |
| 238 // is already present. | 243 // is already present. |
| 239 bool AddLabel(SourceLabel* label); | 244 bool AddLabel(SourceLabel* label); |
| 240 | 245 |
| 241 // Lookup a variable in this scope only. | 246 // Lookup a variable in this scope only. |
| 242 LocalVariable* LocalLookupVariable(const String& name) const; | 247 LocalVariable* LocalLookupVariable(const String& name) const; |
| 243 | 248 |
| 244 // Lookup a label in this scope only. | 249 // Lookup a label in this scope only. |
| 245 SourceLabel* LocalLookupLabel(const String& name) const; | 250 SourceLabel* LocalLookupLabel(const String& name) const; |
| 246 | 251 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // List of names referenced in this scope and its children that | 362 // List of names referenced in this scope and its children that |
| 358 // are not resolved to local variables. | 363 // are not resolved to local variables. |
| 359 GrowableArray<NameReference*> referenced_; | 364 GrowableArray<NameReference*> referenced_; |
| 360 | 365 |
| 361 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 366 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
| 362 }; | 367 }; |
| 363 | 368 |
| 364 } // namespace dart | 369 } // namespace dart |
| 365 | 370 |
| 366 #endif // VM_SCOPES_H_ | 371 #endif // VM_SCOPES_H_ |
| OLD | NEW |