parsley-core-2.2.0.0: A fast parser combinator library backed by Typed Template Haskell
LicenseBSD-3-Clause
MaintainerJamie Willis
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Parsley.Internal.Frontend.Analysis.Dependencies

Description

Exposes dependencyAnalysis, which is used to calculate information regarding the dependencies of each let-bound parser, as well as their free-registers.

Since: 1.5.0.0

Synopsis

Documentation

dependencyAnalysis :: Fix Combinator a -> DMap MVar (Fix Combinator) -> (DMap MVar (Fix Combinator), Map IMVar (Set SomeΣVar)) Source #

Given a top-level parser and a collection of its let-bound subjects performs the following tasks:

  • Determines which parser depend on which others.
  • Use the previous information to remove any dead bindings.
  • Calculate the direct free registers for each binding.
  • Propogate the free registers according to transitive need via the dependency graph.

Returns the non-dead bindings, the information about each bindings free registers, and the next free index for any registers created in code generation.

Since: 1.5.0.0