All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shapesecurity.shift.scope.README.md Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
Shift AST Scope Analyzer
===============================

## Description

The `ScopeAnalyzer` class collects variable scoping information into a scope tree.


## Usage
```
import com.shapesecurity.shift.parser.Parser;
import com.shapesecurity.shift.ast.Program;
import com.shapesecurity.shift.scope.ScopeAnalyzer;
import com.shapesecurity.shift.scope.GlobalScope;

String source = "a; b;";
Script program = Parser.parse(source);
GlobalScope global = ScopeAnalyzer.analyze(program);

// look at the top-level variables

// list the implicit globals (global throughs)

```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy