grammar-combinators-0.2.6: A parsing library of context-free grammar combinators.

Text.GrammarCombinators.Utils.AssessSize

Synopsis

Documentation

assessSize :: forall phi r t rr. (Token t, FoldFam phi) => GExtendedContextFreeGrammar phi t r rr -> IntSource

Assess the size of a given grammar. Primitive rules (token, ref, manyRef, many1Ref, epsilon) are counted as 1 point, combinators like ||| or >>> just add the points of their left and right hand sides. Proposals for better metrics are welcome.