-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | JavaScript static analysis library. -- @package language-ecmascript-analysis @version 0.9.1 -- | 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. module Language.ECMAScript3.Analysis.LabelSet -- | Annotates statements with their label sets. Assuming you've also -- imported Annotations, Arrow and Set, the example -- use would be: -- --
-- lsAnalysis :: JavaScript a -> JavaScript (a, Set Label) -- lsAnalysis = annotateLabelSets snd (\labs -> second $ union labs) . reannotate (a -> (a, empty)) --annotateLabelSets :: Data a => (a -> Set Label) -> (Set Label -> a -> a) -> JavaScript a -> JavaScript a -- | Labels are either strings (identifiers) or empty (see 12.12 of -- the spec) data Label Label :: String -> Label EmptyLabel :: Label instance Typeable Label instance Ord Label instance Eq Label instance Data Label instance Show Label -- | A lexical environment analysis of ECMAScript programs module Language.ECMAScript3.Analysis.LexicalEnvironment env :: Map String SourcePos -> [Statement SourcePos] -> (EnvTree, Map String SourcePos) localVars :: [Statement SourcePos] -> [(String, SourcePos)] -- | The statically-determinate lexical structure of a JavaScript program. data EnvTree EnvTree :: (Map String SourcePos) -> [EnvTree] -> EnvTree