-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Multi-platform parser analyzer and generator. -- -- Multi-platform parser analyzer and generator. @package imparse @version 0.0.0.3 -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse/AbstractSyntax.hs ---- -- Data structure for Imparse parser definitions. module Text.Imparse.AbstractSyntax -- | Parser data structure. type Import = String type NonTerminal = String type Constructor = String type WhitespaceParse = Bool data Parser a Parser :: a -> [Import] -> [Production a] -> Parser a data Production a Production :: a -> NonTerminal -> [Choices a] -> Production a data Choices a Choices :: a -> [Choice a] -> Choices a data Choice a Choice :: a -> (Maybe Constructor) -> Association -> [Element a] -> Choice a type Minimum = Integer type Separator = String type TerminalString = String type RegularExpression = String data Association AssocNone :: Association AssocRight :: Association AssocLeft :: Association AssocFlat :: Association data Element a NonTerminal :: a -> NonTerminal -> Element a Many :: (Element a) -> (Maybe Separator) -> Element a May :: (Element a) -> Element a Indented :: WhitespaceParse -> (Element a) -> Element a Terminal :: Terminal -> Element a Error :: String -> Element a data Terminal Explicit :: String -> Terminal StringLiteral :: Terminal NaturalLiteral :: Terminal DecimalLiteral :: Terminal Identifier :: Terminal Constructor :: Terminal Flag :: Terminal RegExp :: RegularExpression -> Terminal -- | Functions for inspecting parser instances. isOp :: String -> Bool isData :: Element a -> Bool terminals :: Parser a -> [Terminal] productionNonTerminal :: Production a -> NonTerminal instance Eq Association instance Eq Terminal instance Eq a => Eq (Element a) instance Eq a => Eq (Choice a) instance Eq a => Eq (Choices a) instance Eq a => Eq (Production a) instance Eq a => Eq (Parser a) instance Show Terminal instance Show (Element a) instance Show Association instance Show (Choice a) instance Show (Choices a) instance Show (Production a) instance Show (Parser a) instance ToUxADT Terminal instance ToUxADT (Element a) instance ToUxADT (Choice a) instance ToUxADT (Choices a) instance ToUxADT (Production a) instance ToUxADT (Parser a) instance Annotate Element instance Annotate Choice instance Annotate Choices instance Annotate Production instance Annotate Parser -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse/Report.hs ---- -- Generation of rich reports from parser definitions. module Text.Imparse.Report instance ToReport Terminal instance (ToHighlights a, ToMessages a) => ToReport (Element a) instance (ToHighlights a, ToMessages a) => ToReport (Choice a) instance (ToHighlights a, ToMessages a) => ToReport (Choices a) instance (ToHighlights a, ToMessages a) => ToReport (Production a) instance (ToHighlights a, ToMessages a) => ToReport (Parser a) -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse/Parse.hs ---- -- Parser for Imparse parser specification concrete syntax. module Text.Imparse.Parse -- | Exported functions. parseParser :: Analysis a => String -> Either String (Parser a) -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse/Analysis.hs ---- -- Analyzer/validator for Imparse parsers. module Text.Imparse.Analysis -- | Analysis data structure, instance declarations, accessors, and -- mutators. type InitialNonTerminals = [NonTerminal] type InitialTerminals = [Terminal] type ReachableNonTerminals = [NonTerminal] type Characterization = (InitialTerminals, InitialNonTerminals, ReachableNonTerminals) data Analysis Analyzed :: [Tag] -> Characterization -> Analysis data Tag GrammarRecursive :: Tag GrammarNonRecursive :: Tag GrammarLinear :: Tag GrammarLeftLinear :: Tag GrammarRightLinear :: Tag GrammarCFG :: Tag ProductionBase :: Tag ProductionNonRecursive :: Tag ProductionRecursive :: Tag ProductionInfixPrefixThenDeterministic :: Tag ProductionDeterministic :: Tag ProductionDuplicate :: Tag ProductionUnreachable :: Tag ChoicesBase :: Tag ChoicesDeterministic :: Tag ChoicesNonRecursive :: Tag ChoicesRecursive :: Tag ChoicesRecursivePrefixInfix :: Tag ChoiceBase :: Tag ChoiceNonRecursive :: Tag ChoiceRecursive :: Tag ChoiceRecursivePrefix :: Tag ChoiceRecursiveInfix :: Tag ChoiceConstructorDuplicate :: Tag NonTerminalUnbound :: Tag tag :: Analysis -> [Tag] -> Analysis tags :: Annotate a => a Analysis -> [Tag] initialTerminals :: Annotate a => a Analysis -> InitialTerminals initialNonTerminals :: Annotate a => a Analysis -> InitialNonTerminals reachable :: Annotate a => a Analysis -> ReachableNonTerminals characterization :: Annotate a => a Analysis -> Characterization combine :: [Characterization] -> Characterization mapCmb :: (a -> (a, Characterization)) -> [a] -> ([a], Characterization) -- | Baseline analysis (initial non-/terminals and reachable non-terminals) -- and its closure (fully recursive characterization of initial and -- reachable non-/terminals). baseline :: Parser Analysis -> Parser Analysis closure :: Parser Analysis -> Parser Analysis -- | Property derivation and tagging algorithms. tagging :: Parser Analysis -> Parser Analysis analyze :: Parser Analysis -> Parser Analysis -- | Other useful functions. infixPrefixOps :: Parser Analysis -> [String] allOps :: Parser Analysis -> [String] instance Eq Tag instance Show Tag instance Eq Analysis instance Show Analysis instance ToHighlights Tag instance ToMessages Tag instance ToHighlights Analysis instance ToMessages Analysis instance Analysis Analysis -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse/Compile/Haskell.hs ---- -- Compilation from an Imparse parser definition to a Haskell -- implementation of a abstract syntax data type and Parsec parser. module Text.Imparse.Compile.Haskell -- | State data structure data State State :: StateExtensionFresh -> StateExtensionString -> State -- | Helper functions. toLowerFirst :: String -> String -- | Compilation to abstract syntax data type definition. toAbstractSyntax :: String -> Parser a -> Compile State () toDatatype :: Parser a -> Compile State () -- | Compilation to rich reporting instance declarations. toRichReport :: String -> Parser a -> Compile State () toReportFuns :: Parser a -> Compile State () -- | Compilation to Parsec parser. toParsec :: String -> Parser Analysis -> Compile State () toParsecDefs :: Parser Analysis -> Compile State () instance HasString State instance HasFresh State instance StateExtension State -- | Imparse Cross-platform and -language parser generator. -- --
-- Text/Imparse.hs ---- -- Haskell implementation of the Imparse parser parser. Useful functions -- for the imparser parser generator. module Text.Imparse -- | The target of the output, as specified by the command-line arguments. type HaskellModulePrefix = String data OutputTarget HTML :: OutputTarget ASCII :: OutputTarget UXADT :: OutputTarget HASKELL :: HaskellModulePrefix -> OutputTarget emitHaskell :: [OutputTarget] -> Maybe HaskellModulePrefix -- | Take a file path in the form of a string, and try to parse the -- contents of the file into abstract syntax. parseShow :: String -> IO () parse :: String -> IO (Maybe (Parser Analysis)) -- | Take a file path in the form of a string, read it, and process it as -- specified by the command line. nothing :: IO () createDirectoryIfNotExists :: FilePath -> IO () removeIfExists :: FilePath -> IO () fileNamePrefix :: String -> String fileNameDir :: String -> String writeAndPutStr :: String -> String -> String -> IO () procWrite :: [OutputTarget] -> Maybe String -> IO () usage :: IO () cmd :: [OutputTarget] -> [String] -> IO () instance Eq OutputTarget