pinchot-0.24.0.0: Write grammars, not parsers

Safe HaskellNone
LanguageHaskell2010

Pinchot.SyntaxTree.Wrappers

Synopsis

Documentation

wrappedInstances :: [Rule t] -> DecsQ Source #

Creates a Wrapped instance for each Rule and its ancestors, if there is an instance. Only terminal, wrap, opt, star, and plus get instances of Wrapped.

This must be spliced in the same module in which the syntax tree types are created; this way, no orphans are created. Since ancestors are included, you can get the entire tree of types that you need by applying this function to a single start symbol.

Example: Pinchot.Examples.SyntaxTrees.

singleWrappedInstance :: Rule t -> Maybe (Q Dec) Source #

Creates a Wrapped instance for the Rule, if there is one. Only terminal, wrap, opt, star, and plus get instances of Wrapped. 'This must be spliced in the same module in which the syntax tree types are created.

makeWrapped Source #

Arguments

:: TypeQ

Name of wrapped type

-> String

Name of wrapper type

-> Q Dec 

wrappedOpt Source #

Arguments

:: String

Wrapped rule name

-> String

Wrapping Rule name

-> Q Dec 

wrappedTerminal Source #

Arguments

:: String

Wrapper Rule name

-> Q Dec 

wrappedTerminals Source #

Arguments

:: String

Wrapper Rule name

-> Q Dec 

wrappedStar Source #

Arguments

:: String

Wrapped rule name

-> String

Wrapping Rule name

-> Q Dec 

wrappedPlus Source #

Arguments

:: String

Wrapped rule name

-> String

Wrapping Rule name

-> Q Dec 

wrappedWrap Source #

Arguments

:: String

Wrapped rule name

-> String

Wrapping Rule name

-> Q Dec