com.google.caja.parser.js.scope
Interface AbstractScope

All Known Implementing Classes:
OptScope, ScopeAnalyzerTest.TestScope, ScopeTree

public interface AbstractScope

Describes the set of symbols in scope at a point in a JavaScript program.

Author:
mikesamuel@gmail.com

Method Summary
 AbstractScope getContainingScope()
          The scope that contains this scope or null if this is the root scope.
 ScopeType getType()
          The type of scope.
 boolean isSymbolDeclared(java.lang.String name)
          True iff the symbol is declared in this scope.
 

Method Detail

getType

ScopeType getType()
The type of scope.

Returns:
not null, and does not change over the life of the instance.

isSymbolDeclared

boolean isSymbolDeclared(java.lang.String name)
True iff the symbol is declared in this scope. Some symbols may be defined but not declared, such as this and arguments, and the dynamic set of symbols introduced by a with block. This method only deals with declarations that appear in program text.

Parameters:
name - a non null JavaScript identifier.
Returns:
true iff the named symbol is declared in this scope. This does not recurse to parent scopes.

getContainingScope

AbstractScope getContainingScope()
The scope that contains this scope or null if this is the root scope.

Returns:
null or an instance of a subclass of the scope type of the listener that created this instance.


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0