analyses
Basic data flow analyses framework based on esprima
Installation
$ npm install analyses
Dependencies
analyses depends on a globally available Map
, which can either be provided by
running with --harmony
or by preloading a shim before using the library.
analyses itself explicitly does not depend on a shim itself, to be more forward
compatible and to give you more choice.
Since the collections, specifically Set
in --harmony
do not support any method to iterate over them,
analyses provides a minimal analyses.Set
shim with some useful set operations.
This will change once native --harmony
Sets are actually useful.
Usage
var cfg = esgraph(esprima.parse('…'));
var output = analyses(cfg, function (input, list) {
this;
input;
list;
return new analyses.Set();
return {output: new analyses.Set(), enqueue: false}
}, {
direction: 'forward',
merge: analyses.merge(analyses.Set.union),
equals: analyses.Set.equals
});
output.get(cfg[0]).values()
License
LGPLv3