OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ |
| 6 #define V8_PARSING_PREPARSED_SCOPE_DATA_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "src/globals.h" |
| 11 |
| 12 namespace v8 { |
| 13 namespace internal { |
| 14 |
| 15 class PreParsedScopeData { |
| 16 public: |
| 17 PreParsedScopeData() {} |
| 18 ~PreParsedScopeData() {} |
| 19 |
| 20 class ScopeScope { |
| 21 public: |
| 22 ScopeScope(PreParsedScopeData* data, ScopeType scope_type, |
| 23 int start_position, int end_position); |
| 24 ~ScopeScope(); |
| 25 |
| 26 // TODO(marja): The functions for adding information about local variables |
| 27 // will appear here. |
| 28 |
| 29 private: |
| 30 PreParsedScopeData* data_; |
| 31 size_t index_in_data_; |
| 32 ScopeScope* previous_scope_; |
| 33 |
| 34 int inner_scope_count_; |
| 35 int variable_count_; |
| 36 DISALLOW_COPY_AND_ASSIGN(ScopeScope); |
| 37 }; |
| 38 |
| 39 private: |
| 40 friend class ScopeTestHelper; |
| 41 |
| 42 // TODO(marja): Make the backing store more efficient once we know exactly |
| 43 // what data is needed. |
| 44 std::vector<int> backing_store_; |
| 45 ScopeScope* current_scope_ = nullptr; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData); |
| 48 }; |
| 49 |
| 50 } // namespace internal |
| 51 } // namespace v8 |
| 52 |
| 53 #endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_ |
OLD | NEW |