/usr/share/doc/libghc-haxml-doc/html/Text-XML-HaXml-Lex.html is in libghc-haxml-doc 1:1.23.3-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Text.XML.HaXml.Lex</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Text-XML-HaXml-Lex.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-XML-HaXml-Lex.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">HaXml-1.23.3: Utilities for manipulating XML documents</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Text.XML.HaXml.Lex</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Entry points to the lexer
</a></li><li><a href="#g:2">Token types
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>You don't normally need to use this Lex module directly - it is
called automatically by the parser. (This interface is only exposed
for debugging purposes.)
</p><p>This is a hand-written lexer for tokenising the text of an XML
document so that it is ready for parsing. It attaches position
information in (line,column) format to every token. The main
entry point is <code><a href="Text-XML-HaXml-Lex.html#v:xmlLex">xmlLex</a></code>. A secondary entry point, <code><a href="Text-XML-HaXml-Lex.html#v:xmlReLex">xmlReLex</a></code>, is
provided for when the parser needs to stuff a string back onto
the front of the text and re-tokenise it (typically when expanding
macros).
</p><p>As one would expect, the lexer is essentially a small finite
state machine.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:xmlLex">xmlLex</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]</li><li class="src short"><a href="#v:xmlReLex">xmlReLex</a> :: <a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]</li><li class="src short"><a href="#v:reLexEntityValue">reLexEntityValue</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]</li><li class="src short"><span class="keyword">type</span> <a href="#t:Token">Token</a> = (<a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a>, <a href="Text-XML-HaXml-Lex.html#t:TokenT">TokenT</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:TokenT">TokenT</a> <ul class="subs"><li>= <a href="#v:TokCommentOpen">TokCommentOpen</a> </li><li>| <a href="#v:TokCommentClose">TokCommentClose</a> </li><li>| <a href="#v:TokPIOpen">TokPIOpen</a> </li><li>| <a href="#v:TokPIClose">TokPIClose</a> </li><li>| <a href="#v:TokSectionOpen">TokSectionOpen</a> </li><li>| <a href="#v:TokSectionClose">TokSectionClose</a> </li><li>| <a href="#v:TokSection">TokSection</a> <a href="Text-XML-HaXml-Lex.html#t:Section">Section</a> </li><li>| <a href="#v:TokSpecialOpen">TokSpecialOpen</a> </li><li>| <a href="#v:TokSpecial">TokSpecial</a> <a href="Text-XML-HaXml-Lex.html#t:Special">Special</a> </li><li>| <a href="#v:TokEndOpen">TokEndOpen</a> </li><li>| <a href="#v:TokEndClose">TokEndClose</a> </li><li>| <a href="#v:TokAnyOpen">TokAnyOpen</a> </li><li>| <a href="#v:TokAnyClose">TokAnyClose</a> </li><li>| <a href="#v:TokSqOpen">TokSqOpen</a> </li><li>| <a href="#v:TokSqClose">TokSqClose</a> </li><li>| <a href="#v:TokEqual">TokEqual</a> </li><li>| <a href="#v:TokQuery">TokQuery</a> </li><li>| <a href="#v:TokStar">TokStar</a> </li><li>| <a href="#v:TokPlus">TokPlus</a> </li><li>| <a href="#v:TokAmp">TokAmp</a> </li><li>| <a href="#v:TokSemi">TokSemi</a> </li><li>| <a href="#v:TokHash">TokHash</a> </li><li>| <a href="#v:TokBraOpen">TokBraOpen</a> </li><li>| <a href="#v:TokBraClose">TokBraClose</a> </li><li>| <a href="#v:TokPipe">TokPipe</a> </li><li>| <a href="#v:TokPercent">TokPercent</a> </li><li>| <a href="#v:TokComma">TokComma</a> </li><li>| <a href="#v:TokQuote">TokQuote</a> </li><li>| <a href="#v:TokName">TokName</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> </li><li>| <a href="#v:TokFreeText">TokFreeText</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> </li><li>| <a href="#v:TokNull">TokNull</a> </li><li>| <a href="#v:TokError">TokError</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Special">Special</a> <ul class="subs"><li>= <a href="#v:DOCTYPEx">DOCTYPEx</a> </li><li>| <a href="#v:ELEMENTx">ELEMENTx</a> </li><li>| <a href="#v:ATTLISTx">ATTLISTx</a> </li><li>| <a href="#v:ENTITYx">ENTITYx</a> </li><li>| <a href="#v:NOTATIONx">NOTATIONx</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Section">Section</a> <ul class="subs"><li>= <a href="#v:CDATAx">CDATAx</a> </li><li>| <a href="#v:INCLUDEx">INCLUDEx</a> </li><li>| <a href="#v:IGNOREx">IGNOREx</a> </li></ul></li></ul></div><div id="interface"><h1 id="g:1">Entry points to the lexer
</h1><div class="top"><p class="src"><a name="v:xmlLex" class="def">xmlLex</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]<a href="src/Text-XML-HaXml-Lex.html#xmlLex" class="link">Source</a></p><div class="doc"><p>The first argument to <code><a href="Text-XML-HaXml-Lex.html#v:xmlLex">xmlLex</a></code> is the filename (used for source positions,
especially in error messages), and the second is the string content of
the XML file.
</p></div></div><div class="top"><p class="src"><a name="v:xmlReLex" class="def">xmlReLex</a> :: <a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]<a href="src/Text-XML-HaXml-Lex.html#xmlReLex" class="link">Source</a></p><div class="doc"><p><code><a href="Text-XML-HaXml-Lex.html#v:xmlReLex">xmlReLex</a></code> is used when the parser expands a macro (PE reference).
The expansion of the macro must be re-lexed as if for the first time.
</p></div></div><div class="top"><p class="src"><a name="v:reLexEntityValue" class="def">reLexEntityValue</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> [<a href="Text-XML-HaXml-Lex.html#t:Token">Token</a>]<a href="src/Text-XML-HaXml-Lex.html#reLexEntityValue" class="link">Source</a></p><div class="doc"><p><code><a href="Text-XML-HaXml-Lex.html#v:reLexEntityValue">reLexEntityValue</a></code> is used solely within parsing an entityvalue.
Normally, a PERef is logically separated from its surroundings by
whitespace. But in an entityvalue, a PERef can be juxtaposed to
an identifier, so the expansion forms a new identifier.
Thus the need to rescan the whole text for possible PERefs.
</p></div></div><h1 id="g:2">Token types
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Token" class="def">Token</a> = (<a href="Text-XML-HaXml-Posn.html#t:Posn">Posn</a>, <a href="Text-XML-HaXml-Lex.html#t:TokenT">TokenT</a>)<a href="src/Text-XML-HaXml-Lex.html#Token" class="link">Source</a></p><div class="doc"><p>All tokens are paired up with a source position.
Lexical errors are passed back as a special <code>TokenT</code> value.
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TokenT" class="def">TokenT</a> <a href="src/Text-XML-HaXml-Lex.html#TokenT" class="link">Source</a></p><div class="doc"><p>The basic token type.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TokCommentOpen" class="def">TokCommentOpen</a></td><td class="doc"><p><!--
</p></td></tr><tr><td class="src"><a name="v:TokCommentClose" class="def">TokCommentClose</a></td><td class="doc"><ul><li>->
</li></ul></td></tr><tr><td class="src"><a name="v:TokPIOpen" class="def">TokPIOpen</a></td><td class="doc"><p><?
</p></td></tr><tr><td class="src"><a name="v:TokPIClose" class="def">TokPIClose</a></td><td class="doc"><p>?>
</p></td></tr><tr><td class="src"><a name="v:TokSectionOpen" class="def">TokSectionOpen</a></td><td class="doc"><p><![
</p></td></tr><tr><td class="src"><a name="v:TokSectionClose" class="def">TokSectionClose</a></td><td class="doc"><p>]]>
</p></td></tr><tr><td class="src"><a name="v:TokSection" class="def">TokSection</a> <a href="Text-XML-HaXml-Lex.html#t:Section">Section</a></td><td class="doc"><p>CDATA INCLUDE IGNORE etc
</p></td></tr><tr><td class="src"><a name="v:TokSpecialOpen" class="def">TokSpecialOpen</a></td><td class="doc"><p><!
</p></td></tr><tr><td class="src"><a name="v:TokSpecial" class="def">TokSpecial</a> <a href="Text-XML-HaXml-Lex.html#t:Special">Special</a></td><td class="doc"><p>DOCTYPE ELEMENT ATTLIST etc
</p></td></tr><tr><td class="src"><a name="v:TokEndOpen" class="def">TokEndOpen</a></td><td class="doc"><p></
</p></td></tr><tr><td class="src"><a name="v:TokEndClose" class="def">TokEndClose</a></td><td class="doc"><p>/>
</p></td></tr><tr><td class="src"><a name="v:TokAnyOpen" class="def">TokAnyOpen</a></td><td class="doc"><p><
</p></td></tr><tr><td class="src"><a name="v:TokAnyClose" class="def">TokAnyClose</a></td><td class="doc"><pre>
</pre></td></tr><tr><td class="src"><a name="v:TokSqOpen" class="def">TokSqOpen</a></td><td class="doc"><p>[
</p></td></tr><tr><td class="src"><a name="v:TokSqClose" class="def">TokSqClose</a></td><td class="doc"><p>]
</p></td></tr><tr><td class="src"><a name="v:TokEqual" class="def">TokEqual</a></td><td class="doc"><p>=
</p></td></tr><tr><td class="src"><a name="v:TokQuery" class="def">TokQuery</a></td><td class="doc"><p>?
</p></td></tr><tr><td class="src"><a name="v:TokStar" class="def">TokStar</a></td><td class="doc"><p>*
</p></td></tr><tr><td class="src"><a name="v:TokPlus" class="def">TokPlus</a></td><td class="doc"><p>+
</p></td></tr><tr><td class="src"><a name="v:TokAmp" class="def">TokAmp</a></td><td class="doc"><p>&
</p></td></tr><tr><td class="src"><a name="v:TokSemi" class="def">TokSemi</a></td><td class="doc"><p>;
</p></td></tr><tr><td class="src"><a name="v:TokHash" class="def">TokHash</a></td><td class="doc"><p>#
</p></td></tr><tr><td class="src"><a name="v:TokBraOpen" class="def">TokBraOpen</a></td><td class="doc"><p>(
</p></td></tr><tr><td class="src"><a name="v:TokBraClose" class="def">TokBraClose</a></td><td class="doc"><p>)
</p></td></tr><tr><td class="src"><a name="v:TokPipe" class="def">TokPipe</a></td><td class="doc"><p>|
</p></td></tr><tr><td class="src"><a name="v:TokPercent" class="def">TokPercent</a></td><td class="doc"><p>%
</p></td></tr><tr><td class="src"><a name="v:TokComma" class="def">TokComma</a></td><td class="doc"><p>,
</p></td></tr><tr><td class="src"><a name="v:TokQuote" class="def">TokQuote</a></td><td class="doc"><p>'' or ""
</p></td></tr><tr><td class="src"><a name="v:TokName" class="def">TokName</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>begins with letter, no spaces
</p></td></tr><tr><td class="src"><a name="v:TokFreeText" class="def">TokFreeText</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>any character data
</p></td></tr><tr><td class="src"><a name="v:TokNull" class="def">TokNull</a></td><td class="doc"><p>fake token
</p></td></tr><tr><td class="src"><a name="v:TokError" class="def">TokError</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>lexical error
</p></td></tr></table></div><div class="subs instances"><p id="control.i:TokenT" class="caption collapser" onclick="toggleSection('i:TokenT')">Instances</p><div id="section.i:TokenT" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XML-HaXml-Lex.html#t:TokenT">TokenT</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XML-HaXml-Lex.html#t:TokenT">TokenT</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Special" class="def">Special</a> <a href="src/Text-XML-HaXml-Lex.html#Special" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:DOCTYPEx" class="def">DOCTYPEx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ELEMENTx" class="def">ELEMENTx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ATTLISTx" class="def">ATTLISTx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ENTITYx" class="def">ENTITYx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:NOTATIONx" class="def">NOTATIONx</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Special" class="caption collapser" onclick="toggleSection('i:Special')">Instances</p><div id="section.i:Special" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XML-HaXml-Lex.html#t:Special">Special</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XML-HaXml-Lex.html#t:Special">Special</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Section" class="def">Section</a> <a href="src/Text-XML-HaXml-Lex.html#Section" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:CDATAx" class="def">CDATAx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:INCLUDEx" class="def">INCLUDEx</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:IGNOREx" class="def">IGNOREx</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Section" class="caption collapser" onclick="toggleSection('i:Section')">Instances</p><div id="section.i:Section" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XML-HaXml-Lex.html#t:Section">Section</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XML-HaXml-Lex.html#t:Section">Section</a></td><td class="doc empty"> </td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|