language-ecmascript-0.17: JavaScript parser and pretty-printer library

Safe HaskellNone
LanguageHaskell2010

Language.ECMAScript3.Analysis.LabelSets

Description

Deprecated: Use LabelSet from package 'language-ecmascript-analysis'

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.

Synopsis

Documentation

annotateLabelSets Source

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; example use:

>>> let jsa = reannotate (\a -> (a, Set.empty))
>>> in  annotateLabelSets jsa snd (\labs (a, ls) -> (a, labs `Set.union` ls))

data Label Source

Labels are either strings (identifiers) or empty (see 12.12 of the spec)

Constructors

Label String 
EmptyLabel