tagsoup-parsec-0.0.6: Tokenizes Tag, so [ Tag ] can be used as parser input.Source codeContentsIndex
Text.HTML.TagSoup.Parsec
Synopsis
module Text.HTML.TagSoup
type TagParser = GenParser Tag ()
type TagParserSt = GenParser Tag
type WholeTag = (Tag, [Tag], Tag)
tParse :: TagParser a -> [Tag] -> a
tStParse :: TagParserSt st a -> st -> [Tag] -> a
openTag :: String -> TagParserSt st Tag
maybeOpenTag :: String -> TagParserSt st (Maybe Tag)
eitherOpenTag :: String -> TagParserSt st (Either Tag Tag)
notOpenTag :: String -> TagParserSt st Tag
allOpenTags :: String -> TagParserSt st [Tag]
wholeTag :: String -> TagParserSt st WholeTag
maybeWholeTag :: String -> TagParserSt st (Maybe WholeTag)
eitherWholeTag :: String -> TagParserSt st (Either Tag WholeTag)
allWholeTags :: String -> TagParserSt st [WholeTag]
closeTag :: String -> TagParserSt st Tag
maybeCloseTag :: String -> TagParserSt st (Maybe Tag)
eitherCloseTag :: String -> TagParserSt st (Either Tag Tag)
notCloseTag :: String -> TagParserSt st Tag
allCloseTags :: String -> TagParserSt st [Tag]
maybeP :: Show tok => GenParser tok st a -> GenParser tok st (Maybe a)
allP :: GenParser tok st (Maybe a) -> GenParser tok st [a]
eitherP :: Show tok => GenParser tok st a -> GenParser tok st (Either tok a)
Documentation
module Text.HTML.TagSoup
type TagParser = GenParser Tag ()Source
The Tag parser, using Tag as the token.
type TagParserSt = GenParser TagSource
A stateful tag parser This is a new type alias to allow backwards compatibility with old code.
type WholeTag = (Tag, [Tag], Tag)Source
A type represent the TagOpen, any inner tags , and the TagClose.
tParse :: TagParser a -> [Tag] -> aSource
Used to invoke parsing of Tags.
tStParse :: TagParserSt st a -> st -> [Tag] -> aSource
Simply run a stateful tag parser
openTag :: String -> TagParserSt st TagSource
openTag matches a TagOpen with the given name. It is not case sensitive.
maybeOpenTag :: String -> TagParserSt st (Maybe Tag)Source
maybeOpenTag will return Just the tag if it gets a TagOpen with he given name, It will return Nothing otherwise. It is not case sensitive.
eitherOpenTag :: String -> TagParserSt st (Either Tag Tag)Source
either a Right TagOpen or a Left arbitary tag.
notOpenTag :: String -> TagParserSt st TagSource
notOpenTag will match any tag which is not a TagOpen with the given name. It is not case sensitive.
allOpenTags :: String -> TagParserSt st [Tag]Source
allOpenTags will return all TagOpen with the given name. It is not case sensitive.
wholeTag :: String -> TagParserSt st WholeTagSource
wholeTag matches a TagOpen with the given name, then all intervening tags, until it reaches a TagClose with the given name. It is not case sensitive.
maybeWholeTag :: String -> TagParserSt st (Maybe WholeTag)Source
maybeWholeTag will return Just the tag if it gets a WholeTag with he given name, It will return Nothing otherwise. It is not case sensitive.
eitherWholeTag :: String -> TagParserSt st (Either Tag WholeTag)Source
either a Right WholeTag or a Left arbitary tag.
allWholeTags :: String -> TagParserSt st [WholeTag]Source
allWholeTags will return all WholeTag with the given name. It is not case sensitive.
closeTag :: String -> TagParserSt st TagSource
closeTag matches a TagClose with the given name. It is not case sensitive.
maybeCloseTag :: String -> TagParserSt st (Maybe Tag)Source
maybeCloseTag will return Just the tag if it gets a TagClose with he given name, It will return Nothing otherwise. It is not case sensitive.
eitherCloseTag :: String -> TagParserSt st (Either Tag Tag)Source
either a Right TagClose or a Left arbitary tag.
notCloseTag :: String -> TagParserSt st TagSource
notCloseTag will match any tag which is not a TagClose with the given name. It is not case sensitive.
allCloseTags :: String -> TagParserSt st [Tag]Source
allCloseTags will return all TagClose with the given name. It is not case sensitive.
maybeP :: Show tok => GenParser tok st a -> GenParser tok st (Maybe a)Source
maybeP takes a parser, and becomes its Maybe equivalent -- returning Just if it matches, and Nothing if it doesn't.
allP :: GenParser tok st (Maybe a) -> GenParser tok st [a]Source
allP takes a parser which returns a Maybe value, and returns a list of matching tokens.
eitherP :: Show tok => GenParser tok st a -> GenParser tok st (Either tok a)Source
eitherP takes a parser, and becomes its Either equivalent -- returning Right if it matches, and Left of anyToken if it doesn't.
Produced by Haddock version 2.4.2