Class Scope
- java.lang.Object
-
- org.sonar.javascript.tree.symbols.Scope
-
public class Scope extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSymbol(Symbol symbol)SymbolgetSymbol(String name)List<Symbol>getSymbols(Symbol.Kind kind)booleanisBlock()Returns true for block scopes (loops, if, etc.), false for function scopes (script, functions, getter, etc.)booleanisGlobal()SymbollookupSymbol(String name)Scopeouter()Treetree()
-
-
-
Method Detail
-
tree
public Tree tree()
-
outer
public Scope outer()
-
lookupSymbol
public Symbol lookupSymbol(String name)
- Parameters:
name- of the symbol to look for- Returns:
- the symbol corresponding to the given name
-
getSymbols
public List<Symbol> getSymbols(Symbol.Kind kind)
- Parameters:
kind- of the symbols to look for- Returns:
- the symbols corresponding to the given kind
-
isGlobal
public boolean isGlobal()
-
addSymbol
public void addSymbol(Symbol symbol)
-
isBlock
public boolean isBlock()
Returns true for block scopes (loops, if, etc.), false for function scopes (script, functions, getter, etc.)
-
-