| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.ECMAScript3.Analysis.LabelSet
Description
Label-set analysis which annotates all the statements in the script with their label sets according to ECMAScript specification, section 12.12. The result of this analysis are useful for building control-flow graphs.
- annotateLabelSets :: Data a => (a -> Set Label) -> (Set Label -> a -> a) -> JavaScript a -> JavaScript a
- data Label
Documentation
Arguments
| :: Data a | |
| => (a -> Set Label) | annotation read function |
| -> (Set Label -> a -> a) | annotation write function |
| -> JavaScript a | the script to annotate |
| -> JavaScript a |
Annotates statements with their label sets. Assuming you've also imported
Annotations, Arrow and
Set, the example use would be:
lsAnalysis ::JavaScripta ->JavaScript(a,SetLabel) lsAnalysis = annotateLabelSets snd (\labs -> second $ union labs) . reannotate (a -> (a, empty))