Lines Matching refs:scope
29 // Scope for the script execution.
31 // Scopes are nested. Writing goes into the toplevel scope, reading checks
35 // A containing scope can be const or non-const. The const containing scope is
37 // many invocations. A const containing scope, however, prevents us from
39 // variables. So you should use a non-const containing scope whenever possible.
40 class Scope {
52 ProgrammaticProvider(Scope* scope) : scope_(scope) {
65 Scope* scope_;
68 // Options for configuring scope merges.
77 // When set, all existing avlues in the destination scope will be
80 // When false, it will be an error to merge a variable into another scope
88 // be copied to the destination scope. When false, private values will be
92 // When set, values copied to the destination scope will be marked as used
99 // Creates an empty toplevel scope.
100 Scope(const Settings* settings);
102 // Creates a dependent scope.
103 Scope(Scope* parent);
104 Scope(const Scope* parent);
106 ~Scope();
112 Scope* mutable_containing() { return mutable_containing_; }
113 const Scope* mutable_containing() const { return mutable_containing_; }
114 const Scope* const_containing() const { return const_containing_; }
115 const Scope* containing() const {
128 // is not found in a mutable scope, then returns null. Note that the value
129 // could still exist in a const scope, so GetValue() could still return
132 // Say you have a local scope that then refers to the const root scope from
136 // scope, but write operations would only work on values in the derived
137 // scope(s).
147 // The 6 should get set on the nested scope rather than modify the value
151 // Same as GetValue, but if the value exists in a parent scope, we'll copy
152 // it to the current scope. If the return value is non-null, the value is
153 // guaranteed to be set in the current scope. Generatlly this will be used
162 // errors later. Returns a pointer to the value in the current scope (a copy
169 // scope. This does not search recursive scopes. Does nothing if not found.
172 // Removes from this scope all identifiers and templates that are considered
176 // Templates associated with this scope. A template can only be set once, so
183 // Marks the given identifier as (un)used in the current scope.
187 // Checks to see if the scope has a var set that hasn't been used. This is
194 // Checks the scope to see if any values were set but not used, and fills in
198 // Returns all values set in the current scope, without going to the parent
202 // Copies this scope's values into the destination. Values from the
203 // containing scope(s) (normally shadowed into the current one) will not be
204 // copied, neither will the reference to the containing scope (this is why
212 bool NonRecursiveMergeTo(Scope* dest,
218 // Constructs a scope that is a copy of the current one. Nested scopes will
219 // be collapsed until we reach a const containing scope. Private values will
221 // scope as its containing scope (since we assume the const scope won't
223 scoped_ptr<Scope> MakeClosure() const;
225 // Makes an empty scope with the given name. Returns NULL if the name is
227 Scope* MakeTargetDefaults(const std::string& target_type);
229 // Gets the scope associated with the given target name, or null if it hasn't
231 const Scope* GetTargetDefaults(const std::string& target_type) const;
244 // the current scope. Note that querying the state of the flag recursively
258 // The source directory associated with this scope. This will check embedded
260 // an empty dir if no containing scope has a source dir set.
265 // been defined. If a scope can generate items, this non-owning pointer will
266 // point to the storage for such items. The creator of this scope will be
270 // The items in a scope are collected as we go and then dispatched at the end
271 // of execution of a scope so that we can query the previously-generated
274 // This can be null if the current scope can not generate items (like for
284 // Properties are opaque pointers that code can use to set state on a Scope
292 // |found_on_scope| variable will be filled with the actual scope containing
295 void* GetProperty(const void* key, const Scope** found_on_scope) const;
311 // Scopes can have no containing scope (both null), a mutable containing
312 // scope, or a const containing scope. The reason is that when we're doing
313 // a new target, we want to refer to the base_config scope which will be read
317 const Scope* const_containing_;
318 Scope* mutable_containing_;
331 // out of scope.
332 typedef base::hash_map<std::string, Scope*> NamedScopeMap;
336 // scope's filter.
354 DISALLOW_COPY_AND_ASSIGN(Scope);