Lines Matching refs:scope
24 // Scope for the script execution.
26 // Scopes are nested. Writing goes into the toplevel scope, reading checks
30 // A containing scope can be const or non-const. The const containing scope is
32 // many invocations. A const containing scope, however, prevents us from
34 // variables. So you should use a non-const containing scope whenever possible.
35 class Scope {
44 ProgrammaticProvider(Scope* scope) : scope_(scope) {
57 Scope* scope_;
60 // Creates an empty toplevel scope.
61 Scope(const Settings* settings);
63 // Creates a dependent scope.
64 Scope(Scope* parent);
65 Scope(const Scope* parent);
67 ~Scope();
73 Scope* mutable_containing() { return mutable_containing_; }
74 const Scope* mutable_containing() const { return mutable_containing_; }
75 const Scope* const_containing() const { return const_containing_; }
76 const Scope* containing() const {
88 // Same as GetValue, but if the value exists in a parent scope, we'll copy
89 // it to the current scope. If the return value is non-null, the value is
90 // guaranteed to be set in the current scope. Generatlly this will be used
99 // errors later. Returns a pointer to the value in the current scope (a copy
105 // Templates associated with this scope. A template can only be set once, so
112 // Marks the given identifier as (un)used in the current scope.
116 // Checks to see if the scope has a var set that hasn't been used. This is
123 // Checks the scope to see if any values were set but not used, and fills in
127 // Returns all values set in the current scope, without going to the parent
131 // Copies this scope's values into the destination. Values from the
132 // containing scope(s) (normally shadowed into the current one) will not be
133 // copied, neither will the reference to the containing scope (this is why
136 // It is an error to merge a variable into a scope that already has something
137 // with that name in scope (meaning in that scope or in any of its containing
146 bool NonRecursiveMergeTo(Scope* dest,
151 // Makes an empty scope with the given name. Returns NULL if the name is
153 Scope* MakeTargetDefaults(const std::string& target_type);
155 // Gets the scope associated with the given target name, or null if it hasn't
157 const Scope* GetTargetDefaults(const std::string& target_type) const;
171 // the current scope. Note that querying the state of the flag recursively
191 // Properties are opaque pointers that code can use to set state on a Scope
199 // |found_on_scope| variable will be filled with the actual scope containing
202 void* GetProperty(const void* key, const Scope** found_on_scope) const;
218 // Scopes can have no containing scope (both null), a mutable containing
219 // scope, or a const containing scope. The reason is that when we're doing
220 // a new target, we want to refer to the base_config scope which will be read
224 const Scope* const_containing_;
225 Scope* mutable_containing_;
238 // out of scope.
239 typedef base::hash_map<std::string, Scope*> NamedScopeMap;
243 // scope's filter.
257 DISALLOW_COPY_AND_ASSIGN(Scope);