happy-arbitrary
Safe HaskellNone
LanguageHaskell2010

Language.Happy.Arbitrary

Description

Random trees and token lists for a Happy grammar.

Synopsis

Documentation

newtype Config token Source #

How to make a token from the code of its %token pattern.

Constructors

Config 

Fields

defConfig :: (Text -> token) -> Config token Source #

genTokens :: Config token -> Text -> Node (Lexeme Text) -> Gen [token] Source #

Returns the tokens of a tree from genTree.

genTree :: Config token -> Text -> Node (Lexeme Text) -> Gen (GenTree token) Source #

Draws trees with QuickCheck's size in tokens, or as close as the grammar allows.