RERE.Examples.JSON
Description
JSON grammar example.
>>> import RERE
>>>
import RERE
type Size = Mult2 (Plus Nat5 Nat6) Source #
Size of JSON grammar, 22.
jsonRE' :: RE Void Source #
JSON recursive regular expression constructor from jsonCFG.
jsonCFG
jsonRE' = compact (cfgToRE jsonNames jsonCFG)
jsonRE'
compact
cfgToRE
jsonNames
The conversion doesn't optimize the resulting regular expression, but is relatively fast.
>>> size (cfgToRE jsonNames jsonCFG) 232
size (cfgToRE jsonNames jsonCFG)
jsonRE is pre-calculated variant.
jsonRE
>>> size jsonRE 205
size jsonRE
jsonNames :: Vec Size Name Source #
Names of jsonCFG productions.
jsonCFG :: forall a. Ord a => CFG Size a Source #
JSON grammar
jsonRE :: RE Void Source #
Pre-calculated JSON grammar as regular expression.
See jsonRE' for one constructed from jsonCFG.