| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||
This module is part of Sdf2Haskell, a tool for generating Haskell code from an SDF grammar. This module contains functions for manipulating SDF terms. | |||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Collect specific elements from grammars | |||||||||||||||||||||||||||||||
collectLexSorts :: SDF -> [Symbol] | |||||||||||||||||||||||||||||||
Collect all lexically defined sorts from an SDF grammar. | |||||||||||||||||||||||||||||||
collectCfSorts :: SDF -> [Symbol] | |||||||||||||||||||||||||||||||
Collect all defined context-free symbols from an SDF grammar. | |||||||||||||||||||||||||||||||
collectCfProductions :: SDF -> [Production] | |||||||||||||||||||||||||||||||
Collect all context-free productions from an SDF grammar. | |||||||||||||||||||||||||||||||
collectProductions :: SDF -> [Production] | |||||||||||||||||||||||||||||||
Collect all productions from an SDF grammar. | |||||||||||||||||||||||||||||||
collectLexProductions :: SDF -> [Production] | |||||||||||||||||||||||||||||||
Collect all lexical productions from an SDF grammar. | |||||||||||||||||||||||||||||||
collectRanges :: SDF -> [CharRanges] | |||||||||||||||||||||||||||||||
Collect ranges that are non-primitive, i.e. not of the form [c]. | |||||||||||||||||||||||||||||||
Transforming specific SDF parts | |||||||||||||||||||||||||||||||
normalizeCharClass :: SDF -> SDF | |||||||||||||||||||||||||||||||
Normalize Character Classes | |||||||||||||||||||||||||||||||
Pretty-Printing | |||||||||||||||||||||||||||||||
showSdf :: Term a => a -> String | |||||||||||||||||||||||||||||||
Pretty-Printer | |||||||||||||||||||||||||||||||
Select subelements from specific grammar elements | |||||||||||||||||||||||||||||||
getSyms :: Production -> [Symbol] | |||||||||||||||||||||||||||||||
Obtain the argument symbols from a production. | |||||||||||||||||||||||||||||||
getSort :: Production -> Symbol | |||||||||||||||||||||||||||||||
Obtain the result sort from a production. | |||||||||||||||||||||||||||||||
getAttributes :: Production -> Attributes | |||||||||||||||||||||||||||||||
Obtain the attributes of a production | |||||||||||||||||||||||||||||||
getConsAttr :: Attributes -> Maybe String | |||||||||||||||||||||||||||||||
Obtain the constructor attribute from an attribute list, if it exists. | |||||||||||||||||||||||||||||||
getProds :: Productions -> [Production] | |||||||||||||||||||||||||||||||
Get list of productions from Productions. | |||||||||||||||||||||||||||||||
Test for properties of specific elements | |||||||||||||||||||||||||||||||
isRejectOrBracket :: Production -> Bool | |||||||||||||||||||||||||||||||
Test whether production has reject or bracket attributes. | |||||||||||||||||||||||||||||||
Conversion helpers | |||||||||||||||||||||||||||||||
dequote :: String -> String | |||||||||||||||||||||||||||||||
Turn a quoted literal into a non-quoted string | |||||||||||||||||||||||||||||||
module Sdf | |||||||||||||||||||||||||||||||
Produced by Haddock version 0.6 |