Sdf2HaskellContentsIndex
Sdf2Cfg
Portability portable
Stability experimental
Maintainer Joost Visser
Contents
Starting point
Generate type synonyms from lexical sorts
Generate data declarations from context-free productions
Description
This module is part of Sdf2Haskell, a tool for generating Haskell code from an SDF grammar. This module contains functions generating abstract syntax types.
Synopsis
completeCfg :: [CfgProd] -> ([Symb Char String], [Symb Char String])
type CfgProd = Prod Char String
type CfgSymb = Symb Char String
genCfgDecl :: SDF -> [CfgProd]
ranges2Chars :: CharRanges -> [Char]
ranges2prods :: CharRanges -> [CfgProd]
sdfprod2cfgprod :: Production -> CfgProd
sort2nt :: Symbol -> CfgSymb
sdfChar2t :: Character -> Char
symbol2sym :: Symbol -> CfgSymb
genSyntaxDecls :: SDF -> [HsDecl]
genTypeDecls :: SDF -> [HsDecl]
sort2typedecl :: Symbol -> [HsDecl]
genDataDecls :: SDF -> [HsDecl]
production2datadecl :: Production -> Maybe HsDecl
symbols2types :: [Symbol] -> [HsBangType]
symbol2bangtype :: Symbol -> [HsBangType]
Documentation
completeCfg :: [CfgProd] -> ([Symb Char String], [Symb Char String])
Starting point
type CfgProd = Prod Char String
type CfgSymb = Symb Char String
genCfgDecl :: SDF -> [CfgProd]
ranges2Chars :: CharRanges -> [Char]
ranges2prods :: CharRanges -> [CfgProd]
sdfprod2cfgprod :: Production -> CfgProd
sort2nt :: Symbol -> CfgSymb
sdfChar2t :: Character -> Char
symbol2sym :: Symbol -> CfgSymb
genSyntaxDecls :: SDF -> [HsDecl]
Generate type declarations for representation of abstract syntax.
Generate type synonyms from lexical sorts
genTypeDecls :: SDF -> [HsDecl]
Generate Haskell type declarations for all lexical sorts defined in a given SDF grammar.
sort2typedecl :: Symbol -> [HsDecl]
Convert a lexical SDF sort to a Haskell type synonym.
Generate data declarations from context-free productions
genDataDecls :: SDF -> [HsDecl]
Generate Haskell data declarations for all context-free productions in a given SDF grammar.
production2datadecl :: Production -> Maybe HsDecl
Convert a context-free SDF production to a Haskell data declaration with a single data constructor.
symbols2types :: [Symbol] -> [HsBangType]
Convert Sdf symbols to Haskell types.
symbol2bangtype :: Symbol -> [HsBangType]
Convert an Sdf symbol into Haskell types. The result type is actually a list of Haskell types rather than a single one, though I do not remember why...
Produced by Haddock version 0.6