comunic/3rdparty/luminous/docs/html/classLuminousScanner.html

985 lines
61 KiB
HTML
Raw Permalink Normal View History

2016-11-19 11:08:12 +00:00
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Luminous: LuminousScanner Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Luminous
&#160;<span id="projectnumber">git-master</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classLuminousScanner-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LuminousScanner Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>the base class for all scanners
<a href="classLuminousScanner.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for LuminousScanner:</div>
<div class="dyncontent">
<div class="center"><img src="classLuminousScanner__inherit__graph.png" border="0" usemap="#LuminousScanner_inherit__map" alt="Inheritance graph"/></div>
<map name="LuminousScanner_inherit__map" id="LuminousScanner_inherit__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for LuminousScanner:</div>
<div class="dyncontent">
<div class="center"><img src="classLuminousScanner__coll__graph.png" border="0" usemap="#LuminousScanner_coll__map" alt="Collaboration graph"/></div>
<map name="LuminousScanner_coll__map" id="LuminousScanner_coll__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a493a069a6ba279b279865111b8e8ffd4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a493a069a6ba279b279865111b8e8ffd4"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a493a069a6ba279b279865111b8e8ffd4">__construct</a> ($src=null)</td></tr>
<tr class="memdesc:a493a069a6ba279b279865111b8e8ffd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">constructor <br/></td></tr>
<tr class="memitem:a17a50bdadaa49f0638638d5c6da7090c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a17a50bdadaa49f0638638d5c6da7090c">add_filter</a> ($arg1, $arg2, $arg3=null)</td></tr>
<tr class="memdesc:a17a50bdadaa49f0638638d5c6da7090c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an individual token filter. <a href="#a17a50bdadaa49f0638638d5c6da7090c"></a><br/></td></tr>
<tr class="memitem:a047ae1afbf5563184e3dc67ecfb90a8c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a047ae1afbf5563184e3dc67ecfb90a8c">add_identifier_mapping</a> ($name, $matches)</td></tr>
<tr class="memdesc:a047ae1afbf5563184e3dc67ecfb90a8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an identifier mapping which is later analysed by map_identifier_filter. <a href="#a047ae1afbf5563184e3dc67ecfb90a8c"></a><br/></td></tr>
<tr class="memitem:a32eb459cd8ad20b8ea3403907d7f2e52"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a32eb459cd8ad20b8ea3403907d7f2e52">add_stream_filter</a> ($arg1, $arg2=null)</td></tr>
<tr class="memdesc:a32eb459cd8ad20b8ea3403907d7f2e52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a stream filter. <a href="#a32eb459cd8ad20b8ea3403907d7f2e52"></a><br/></td></tr>
<tr class="memitem:a0a7907663241caffb546ef22bb35d870"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a0a7907663241caffb546ef22bb35d870">highlight</a> ($src)</td></tr>
<tr class="memdesc:a0a7907663241caffb546ef22bb35d870"><td class="mdescLeft">&#160;</td><td class="mdescRight">Public convenience function for setting the string and highlighting it. <a href="#a0a7907663241caffb546ef22bb35d870"></a><br/></td></tr>
<tr class="memitem:af0aecba631e56a3005157cfbe84d6b67"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#af0aecba631e56a3005157cfbe84d6b67">init</a> ()</td></tr>
<tr class="memdesc:af0aecba631e56a3005157cfbe84d6b67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set up the scanner immediately prior to tokenization. <a href="#af0aecba631e56a3005157cfbe84d6b67"></a><br/></td></tr>
<tr class="memitem:a12220a789d49b7e8f42cf873966b6756"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a12220a789d49b7e8f42cf873966b6756">main</a> ()</td></tr>
<tr class="memdesc:a12220a789d49b7e8f42cf873966b6756"><td class="mdescLeft">&#160;</td><td class="mdescRight">the method responsible for tokenization <a href="#a12220a789d49b7e8f42cf873966b6756"></a><br/></td></tr>
<tr class="memitem:a6efd3dada50a424d7f30b7f9afac5fc0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a6efd3dada50a424d7f30b7f9afac5fc0">map_identifier_filter</a> ($token)</td></tr>
<tr class="memdesc:a6efd3dada50a424d7f30b7f9afac5fc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Identifier mapping filter. <a href="#a6efd3dada50a424d7f30b7f9afac5fc0"></a><br/></td></tr>
<tr class="memitem:ae974cbfb732f008a79482ffc4f11d398"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ae974cbfb732f008a79482ffc4f11d398">nestable_token</a> ($token_name, $open, $close)</td></tr>
<tr class="memdesc:ae974cbfb732f008a79482ffc4f11d398"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles tokens that may nest inside themselves. <a href="#ae974cbfb732f008a79482ffc4f11d398"></a><br/></td></tr>
<tr class="memitem:a614e490335cf64375c52d57edfb398ad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a614e490335cf64375c52d57edfb398ad">pop</a> ()</td></tr>
<tr class="memdesc:a614e490335cf64375c52d57edfb398ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pops the top element of the stack, and returns it. <a href="#a614e490335cf64375c52d57edfb398ad"></a><br/></td></tr>
<tr class="memitem:add1da033592e8f944660b9e29088a2ac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add1da033592e8f944660b9e29088a2ac"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#add1da033592e8f944660b9e29088a2ac">push</a> ($<a class="el" href="classLuminousScanner.html#a23e2cf34969c3d39cd34a4b5ce6810ca">state</a>)</td></tr>
<tr class="memdesc:add1da033592e8f944660b9e29088a2ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushes some data onto the stack. <br/></td></tr>
<tr class="memitem:aa61dbaafd8801e40094cbff52f7b22f1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#aa61dbaafd8801e40094cbff52f7b22f1">record</a> ($<a class="el" href="classScanner.html#a577a70297f4d3da0aa2ce4decc66eeea">string</a>, $type, $pre_escaped=false)</td></tr>
<tr class="memdesc:aa61dbaafd8801e40094cbff52f7b22f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Records a string as a given token type. <a href="#aa61dbaafd8801e40094cbff52f7b22f1"></a><br/></td></tr>
<tr class="memitem:a48fabeb9791b36ace2b46dd8f91a4afa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a48fabeb9791b36ace2b46dd8f91a4afa">record_range</a> ($from, $to, $type)</td></tr>
<tr class="memdesc:a48fabeb9791b36ace2b46dd8f91a4afa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function to record a range of the string. <a href="#a48fabeb9791b36ace2b46dd8f91a4afa"></a><br/></td></tr>
<tr class="memitem:a80c4b9fff3a38e90e04cda38eb075040"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a80c4b9fff3a38e90e04cda38eb075040"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a80c4b9fff3a38e90e04cda38eb075040">remove_filter</a> ($name)</td></tr>
<tr class="memdesc:a80c4b9fff3a38e90e04cda38eb075040"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the individual filter(s) with the given name. <br/></td></tr>
<tr class="memitem:a25c4c1f42c64a07ce87c19f3992a0fba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25c4c1f42c64a07ce87c19f3992a0fba"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a25c4c1f42c64a07ce87c19f3992a0fba">remove_stream_filter</a> ($name)</td></tr>
<tr class="memdesc:a25c4c1f42c64a07ce87c19f3992a0fba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the stream filter(s) with the given name. <br/></td></tr>
<tr class="memitem:ab06dcdea11ff9a78168547b4c84c650c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ab06dcdea11ff9a78168547b4c84c650c">skip_whitespace</a> ()</td></tr>
<tr class="memdesc:ab06dcdea11ff9a78168547b4c84c650c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Skips whitespace, and records it as a null token. <a href="#ab06dcdea11ff9a78168547b4c84c650c"></a><br/></td></tr>
<tr class="memitem:a4156922baa33783377f7904fd2d4cee5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4156922baa33783377f7904fd2d4cee5"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a4156922baa33783377f7904fd2d4cee5">start</a> ()</td></tr>
<tr class="memdesc:a4156922baa33783377f7904fd2d4cee5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes the token stream. <br/></td></tr>
<tr class="memitem:a23e2cf34969c3d39cd34a4b5ce6810ca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a23e2cf34969c3d39cd34a4b5ce6810ca"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a23e2cf34969c3d39cd34a4b5ce6810ca">state</a> ()</td></tr>
<tr class="memdesc:a23e2cf34969c3d39cd34a4b5ce6810ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the top element on $state_ or null if it is empty. <br/></td></tr>
<tr class="memitem:a809c11561c650c7784edd3d06243b8b5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a809c11561c650c7784edd3d06243b8b5">tagged</a> ()</td></tr>
<tr class="memdesc:a809c11561c650c7784edd3d06243b8b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the XML representation of the token stream. <a href="#a809c11561c650c7784edd3d06243b8b5"></a><br/></td></tr>
<tr class="memitem:ae381e3000c83ae4cb2259d0ae77a14ab"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ae381e3000c83ae4cb2259d0ae77a14ab">token_array</a> ()</td></tr>
<tr class="memdesc:ae381e3000c83ae4cb2259d0ae77a14ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the token array. <a href="#ae381e3000c83ae4cb2259d0ae77a14ab"></a><br/></td></tr>
<tr class="inherit_header pub_methods_classScanner"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classScanner')"><img src="closed.png" alt="-"/>&nbsp;Public Member Functions inherited from <a class="el" href="classScanner.html">Scanner</a></td></tr>
<tr class="memitem:a4cb6935d759ee0c75fa01b75e2d0ec04 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a4cb6935d759ee0c75fa01b75e2d0ec04">add_pattern</a> ($name, $pattern)</td></tr>
<tr class="memdesc:a4cb6935d759ee0c75fa01b75e2d0ec04 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allows the caller to add a predefined named pattern. <a href="#a4cb6935d759ee0c75fa01b75e2d0ec04"></a><br/></td></tr>
<tr class="memitem:a77abc2d2de424e73d1ee659fd9001e4a inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a77abc2d2de424e73d1ee659fd9001e4a">bol</a> ()</td></tr>
<tr class="memdesc:a77abc2d2de424e73d1ee659fd9001e4a inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Beginning of line? <a href="#a77abc2d2de424e73d1ee659fd9001e4a"></a><br/></td></tr>
<tr class="memitem:ae483fc35eae064c75f8b5ca105826757 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#ae483fc35eae064c75f8b5ca105826757">check</a> ($pattern)</td></tr>
<tr class="memdesc:ae483fc35eae064c75f8b5ca105826757 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Non-consuming lookahead. <a href="#ae483fc35eae064c75f8b5ca105826757"></a><br/></td></tr>
<tr class="memitem:a8ad6032d3a1f955608905c10a864aee6 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a8ad6032d3a1f955608905c10a864aee6">eol</a> ()</td></tr>
<tr class="memdesc:a8ad6032d3a1f955608905c10a864aee6 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">End of line? <a href="#a8ad6032d3a1f955608905c10a864aee6"></a><br/></td></tr>
<tr class="memitem:a23543739aee09e2e1961a556a9672c7d inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a23543739aee09e2e1961a556a9672c7d">eos</a> ()</td></tr>
<tr class="memdesc:a23543739aee09e2e1961a556a9672c7d inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">End of string? <a href="#a23543739aee09e2e1961a556a9672c7d"></a><br/></td></tr>
<tr class="memitem:a154d424c925ed0d58e033f1e71ceef03 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a154d424c925ed0d58e033f1e71ceef03">get</a> ($n=1)</td></tr>
<tr class="memdesc:a154d424c925ed0d58e033f1e71ceef03 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Consume a given number of bytes. <a href="#a154d424c925ed0d58e033f1e71ceef03"></a><br/></td></tr>
<tr class="memitem:ac8beec743c18d54cec51273b3bb7f3b5 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#ac8beec743c18d54cec51273b3bb7f3b5">get_next</a> ($patterns)</td></tr>
<tr class="memdesc:ac8beec743c18d54cec51273b3bb7f3b5 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Look for the next occurrence of a set of patterns. <a href="#ac8beec743c18d54cec51273b3bb7f3b5"></a><br/></td></tr>
<tr class="memitem:a21f59cd38d7ed3ccd43955386b6aa14e inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a21f59cd38d7ed3ccd43955386b6aa14e">get_next_named</a> ($patterns)</td></tr>
<tr class="memdesc:a21f59cd38d7ed3ccd43955386b6aa14e inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the index of the next occurrence of a named pattern. <a href="#a21f59cd38d7ed3ccd43955386b6aa14e"></a><br/></td></tr>
<tr class="memitem:a57774c7a298bb43c1c4406a830d386a6 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a57774c7a298bb43c1c4406a830d386a6">get_next_strpos</a> ($patterns)</td></tr>
<tr class="memdesc:a57774c7a298bb43c1c4406a830d386a6 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Look for the next occurrence of a set of substrings. <a href="#a57774c7a298bb43c1c4406a830d386a6"></a><br/></td></tr>
<tr class="memitem:a90bacd70c30eb1d76659c0586f0683d2 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a90bacd70c30eb1d76659c0586f0683d2">index</a> ($pattern)</td></tr>
<tr class="memdesc:a90bacd70c30eb1d76659c0586f0683d2 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the index of the next occurrence of a pattern. <a href="#a90bacd70c30eb1d76659c0586f0683d2"></a><br/></td></tr>
<tr class="memitem:a17ac6e2abcb54a6dfaa9abaf95ed839e inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a17ac6e2abcb54a6dfaa9abaf95ed839e">match</a> ()</td></tr>
<tr class="memdesc:a17ac6e2abcb54a6dfaa9abaf95ed839e inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the result of the most recent match operation. <a href="#a17ac6e2abcb54a6dfaa9abaf95ed839e"></a><br/></td></tr>
<tr class="memitem:aa933ee80eb310785c75ab7b03ed01885 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#aa933ee80eb310785c75ab7b03ed01885">match_group</a> ($g=0)</td></tr>
<tr class="memdesc:aa933ee80eb310785c75ab7b03ed01885 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a group from the most recent match operation. <a href="#aa933ee80eb310785c75ab7b03ed01885"></a><br/></td></tr>
<tr class="memitem:a9271f0acf8d19f83fa45ee3ee1d3eab5 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a9271f0acf8d19f83fa45ee3ee1d3eab5">match_groups</a> ()</td></tr>
<tr class="memdesc:a9271f0acf8d19f83fa45ee3ee1d3eab5 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the match groups of the most recent match operation. <a href="#a9271f0acf8d19f83fa45ee3ee1d3eab5"></a><br/></td></tr>
<tr class="memitem:aa5520e0fc7df54d7a25d75037e6cdc8a inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#aa5520e0fc7df54d7a25d75037e6cdc8a">match_pos</a> ()</td></tr>
<tr class="memdesc:aa5520e0fc7df54d7a25d75037e6cdc8a inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the position (offset) of the most recent match. <a href="#aa5520e0fc7df54d7a25d75037e6cdc8a"></a><br/></td></tr>
<tr class="memitem:a5e03667fd1cdc1d1fd40a4bc15570b12 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a5e03667fd1cdc1d1fd40a4bc15570b12">next_match</a> ($consume_and_log=true)</td></tr>
<tr class="memdesc:a5e03667fd1cdc1d1fd40a4bc15570b12 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Automation function: returns the next occurrence of any known patterns. <a href="#a5e03667fd1cdc1d1fd40a4bc15570b12"></a><br/></td></tr>
<tr class="memitem:a3028e787442cf1ed9252397ed029b223 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a3028e787442cf1ed9252397ed029b223">peek</a> ($n=1)</td></tr>
<tr class="memdesc:a3028e787442cf1ed9252397ed029b223 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lookahead into the string a given number of bytes. <a href="#a3028e787442cf1ed9252397ed029b223"></a><br/></td></tr>
<tr class="memitem:a546cafdcfc3adeb19959ae14dff10996 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a546cafdcfc3adeb19959ae14dff10996">pos</a> ($new_pos=null)</td></tr>
<tr class="memdesc:a546cafdcfc3adeb19959ae14dff10996 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Getter and setter for the current position (string pointer). <a href="#a546cafdcfc3adeb19959ae14dff10996"></a><br/></td></tr>
<tr class="memitem:a947d15fe4bd13b64afd5eaba8d4d3819 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a947d15fe4bd13b64afd5eaba8d4d3819">pos_shift</a> ($offset)</td></tr>
<tr class="memdesc:a947d15fe4bd13b64afd5eaba8d4d3819 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves the string pointer by a given offset. <a href="#a947d15fe4bd13b64afd5eaba8d4d3819"></a><br/></td></tr>
<tr class="memitem:a79c559549e2dd73c3f1892e7609e84a6 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a79c559549e2dd73c3f1892e7609e84a6">remove_pattern</a> ($name)</td></tr>
<tr class="memdesc:a79c559549e2dd73c3f1892e7609e84a6 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allows the caller to remove a named pattern. <a href="#a79c559549e2dd73c3f1892e7609e84a6"></a><br/></td></tr>
<tr class="memitem:a89d1448f666d1be3d5037c69f24eb516 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a89d1448f666d1be3d5037c69f24eb516">reset</a> ()</td></tr>
<tr class="memdesc:a89d1448f666d1be3d5037c69f24eb516 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the scanner. <a href="#a89d1448f666d1be3d5037c69f24eb516"></a><br/></td></tr>
<tr class="memitem:aeae50ecaf6b98a0b76f47c3d04b8deb3 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#aeae50ecaf6b98a0b76f47c3d04b8deb3">rest</a> ()</td></tr>
<tr class="memdesc:aeae50ecaf6b98a0b76f47c3d04b8deb3 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the remaining string. <a href="#aeae50ecaf6b98a0b76f47c3d04b8deb3"></a><br/></td></tr>
<tr class="memitem:a78ddb203c30c2f9e69755ec00c341add inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a78ddb203c30c2f9e69755ec00c341add">scan</a> ($pattern)</td></tr>
<tr class="memdesc:a78ddb203c30c2f9e69755ec00c341add inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scans at the current pointer. <a href="#a78ddb203c30c2f9e69755ec00c341add"></a><br/></td></tr>
<tr class="memitem:aa0e261d4b0c2fce43ba3c264036afd72 inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#aa0e261d4b0c2fce43ba3c264036afd72">scan_until</a> ($pattern)</td></tr>
<tr class="memdesc:aa0e261d4b0c2fce43ba3c264036afd72 inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scans until the start of a pattern. <a href="#aa0e261d4b0c2fce43ba3c264036afd72"></a><br/></td></tr>
<tr class="memitem:a577a70297f4d3da0aa2ce4decc66eeea inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a577a70297f4d3da0aa2ce4decc66eeea">string</a> ($s=null)</td></tr>
<tr class="memdesc:a577a70297f4d3da0aa2ce4decc66eeea inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Getter and setter for the source string. <a href="#a577a70297f4d3da0aa2ce4decc66eeea"></a><br/></td></tr>
<tr class="memitem:a185d6e780752848cb282add6d9f936bb inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a185d6e780752848cb282add6d9f936bb">terminate</a> ()</td></tr>
<tr class="memdesc:a185d6e780752848cb282add6d9f936bb inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ends scanning of a string. <a href="#a185d6e780752848cb282add6d9f936bb"></a><br/></td></tr>
<tr class="memitem:a6f6665b8df561788b1b2dea40bb394ae inherit pub_methods_classScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classScanner.html#a6f6665b8df561788b1b2dea40bb394ae">unscan</a> ()</td></tr>
<tr class="memdesc:a6f6665b8df561788b1b2dea40bb394ae inherit pub_methods_classScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Revert the most recent scanning operation. <a href="#a6f6665b8df561788b1b2dea40bb394ae"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a094a64c9eb09e38ab43c865e1a4482c9"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a094a64c9eb09e38ab43c865e1a4482c9">guess_language</a> ($src, $info)</td></tr>
<tr class="memdesc:a094a64c9eb09e38ab43c865e1a4482c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Language guessing. <a href="#a094a64c9eb09e38ab43c865e1a4482c9"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a22a1e366c9fbe4e837de693258c5c739"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a22a1e366c9fbe4e837de693258c5c739"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a22a1e366c9fbe4e837de693258c5c739">$version</a> = 'master'</td></tr>
<tr class="memdesc:a22a1e366c9fbe4e837de693258c5c739"><td class="mdescLeft">&#160;</td><td class="mdescRight">scanner version. <br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a4cc936af136b39a54db6c7212c04cee7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a4cc936af136b39a54db6c7212c04cee7">rule_mapper_filter</a> ($tokens)</td></tr>
<tr class="memdesc:a4cc936af136b39a54db6c7212c04cee7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rule re-mapper filter. <a href="#a4cc936af136b39a54db6c7212c04cee7"></a><br/></td></tr>
<tr class="memitem:a463b3eb270a7afb960ee642bccc0d1b6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a463b3eb270a7afb960ee642bccc0d1b6">user_def_filter</a> ($token)</td></tr>
<tr class="memdesc:a463b3eb270a7afb960ee642bccc0d1b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Filter to highlight identifiers whose definitions are in the source. <a href="#a463b3eb270a7afb960ee642bccc0d1b6"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:af3887911498a250b2cb1fe737dd87df1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#af3887911498a250b2cb1fe737dd87df1">$case_sensitive</a> = true</td></tr>
<tr class="memdesc:af3887911498a250b2cb1fe737dd87df1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether or not the language is case sensitive. <a href="#af3887911498a250b2cb1fe737dd87df1"></a><br/></td></tr>
<tr class="memitem:aca257c4da52076f42c6e53d9d0d33dd1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#aca257c4da52076f42c6e53d9d0d33dd1">$filters</a> = array()</td></tr>
<tr class="memdesc:aca257c4da52076f42c6e53d9d0d33dd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Individual token filters. <a href="#aca257c4da52076f42c6e53d9d0d33dd1"></a><br/></td></tr>
<tr class="memitem:adb13455bbeb076cd0f031f050ef31a82"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#adb13455bbeb076cd0f031f050ef31a82">$ident_map</a> = array()</td></tr>
<tr class="memdesc:adb13455bbeb076cd0f031f050ef31a82"><td class="mdescLeft">&#160;</td><td class="mdescRight">A map of identifiers and their corresponding token names. <a href="#adb13455bbeb076cd0f031f050ef31a82"></a><br/></td></tr>
<tr class="memitem:a30aaa5d3076a9f28d00f167a1c4eac34"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a30aaa5d3076a9f28d00f167a1c4eac34">$rule_tag_map</a> = array()</td></tr>
<tr class="memdesc:a30aaa5d3076a9f28d00f167a1c4eac34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rule remappings. <a href="#a30aaa5d3076a9f28d00f167a1c4eac34"></a><br/></td></tr>
<tr class="memitem:ab5a30262ceb4324fdfaac1a7d217ba36"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ab5a30262ceb4324fdfaac1a7d217ba36">$state_</a> = array()</td></tr>
<tr class="memdesc:ab5a30262ceb4324fdfaac1a7d217ba36"><td class="mdescLeft">&#160;</td><td class="mdescRight">State stack. <a href="#ab5a30262ceb4324fdfaac1a7d217ba36"></a><br/></td></tr>
<tr class="memitem:ad3d9ad7f7f14bc9de3dd6b68225ce21c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ad3d9ad7f7f14bc9de3dd6b68225ce21c">$stream_filters</a> = array()</td></tr>
<tr class="memdesc:ad3d9ad7f7f14bc9de3dd6b68225ce21c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Token stream filters. <a href="#ad3d9ad7f7f14bc9de3dd6b68225ce21c"></a><br/></td></tr>
<tr class="memitem:ab29032700812b580e5d09b6128202286"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#ab29032700812b580e5d09b6128202286">$tokens</a> = array()</td></tr>
<tr class="memdesc:ab29032700812b580e5d09b6128202286"><td class="mdescLeft">&#160;</td><td class="mdescRight">The token stream. <a href="#ab29032700812b580e5d09b6128202286"></a><br/></td></tr>
<tr class="memitem:a615d93f42d9290b9fad4d84cc2fd84ec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousScanner.html#a615d93f42d9290b9fad4d84cc2fd84ec">$user_defs</a></td></tr>
<tr class="memdesc:a615d93f42d9290b9fad4d84cc2fd84ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Identifier remappings based on definitions identified in the source code. <a href="#a615d93f42d9290b9fad4d84cc2fd84ec"></a><br/></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>the base class for all scanners </p>
<p><a class="el" href="classLuminousScanner.html" title="the base class for all scanners">LuminousScanner</a> is the base class for all language scanners. Here we provide a set of methods comprising a highlighting layer. This includes recording a token stream, and ultimately being responsible for producing some XML representing the token stream.</p>
<p>We also define here some filters which rely on state information expected to be recorded into the instance variables.</p>
<p>Highlighting a string at this level is a four-stage process: </p>
<pre class="fragment"> @li string() - set the string
@li init() - set up the scanner
@li main() - perform tokenization
@li tagged() - build the XML
</pre><p>A note on tokens: Tokens are stored as an array with the following indices: </p>
<ul>
<li>0: Token name (e.g. 'COMMENT' </li>
<li>1: Token string (e.g. '// foo') </li>
<li>2: escaped? (bool) Because it's often more convenient to embed nested tokens by tagging token string, we need to escape it. This index stores whether or nto it has been escaped. </li>
</ul>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="a17a50bdadaa49f0638638d5c6da7090c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::add_filter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$arg2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$arg3</em> = <code>null</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add an individual token filter. </p>
<p>Adds an indivdual token filter. The filter is bound to the given token_name. The filter is a callback which should take a token and return a token.</p>
<p>The arguments are: [name], token_name, filter</p>
<p>Name is an optional argument. </p>
</div>
</div>
<a class="anchor" id="a047ae1afbf5563184e3dc67ecfb90a8c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::add_identifier_mapping </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$matches</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds an identifier mapping which is later analysed by map_identifier_filter. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$name</td><td>The token name </td></tr>
<tr><td class="paramname">$matches</td><td>an array of identifiers which correspond to this token name, i.e. add_identifier_mapping('KEYWORD', array('if', 'else', ...));</td></tr>
</table>
</dd>
</dl>
<p>This method observes <a class="el" href="classLuminousScanner.html#af3887911498a250b2cb1fe737dd87df1" title="Whether or not the language is case sensitive.">LuminousScanner::$case_sensitive</a> </p>
</div>
</div>
<a class="anchor" id="a32eb459cd8ad20b8ea3403907d7f2e52"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::add_stream_filter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$arg1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$arg2</em> = <code>null</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a stream filter. </p>
<p>A stream filter receives the entire token stream and should return it.</p>
<p>The parameters are: ([name], filter). Name is an optional argument. </p>
</div>
</div>
<a class="anchor" id="a094a64c9eb09e38ab43c865e1a4482c9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousScanner::guess_language </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$info</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Language guessing. </p>
<p>Each real language scanner should override this method and implement a simple guessing function to estimate how likely the input source code is to be the language which they recognise.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$src</td><td>the input source code </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The estimated chance that the source code is in the same language as the one the scanner tokenizes, as a real number between 0 (least likely) and 1 (most likely), inclusive </dd></dl>
</div>
</div>
<a class="anchor" id="a0a7907663241caffb546ef22bb35d870"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::highlight </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$src</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Public convenience function for setting the string and highlighting it. </p>
<p>Alias for: $s-&gt;string($src) $s-&gt;<a class="el" href="classLuminousScanner.html#af0aecba631e56a3005157cfbe84d6b67" title="Set up the scanner immediately prior to tokenization.">init()</a>; $s-&gt;<a class="el" href="classLuminousScanner.html#a12220a789d49b7e8f42cf873966b6756" title="the method responsible for tokenization">main()</a>; return $s-&gt;<a class="el" href="classLuminousScanner.html#a809c11561c650c7784edd3d06243b8b5" title="Returns the XML representation of the token stream.">tagged()</a>;</p>
<dl class="section return"><dt>Returns</dt><dd>the highlighted string, as an XML string </dd></dl>
</div>
</div>
<a class="anchor" id="af0aecba631e56a3005157cfbe84d6b67"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::init </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set up the scanner immediately prior to tokenization. </p>
<p>The init method is always called prior to <a class="el" href="classLuminousScanner.html#a12220a789d49b7e8f42cf873966b6756" title="the method responsible for tokenization">main()</a>. At this stage, all configuration variables are assumed to have been set, and it's now time for the scanner to perform any last set-up information. This may include actually finalizing its rule patterns. Some scanners may not need to override this if they are in no way dynamic. </p>
</div>
</div>
<a class="anchor" id="a12220a789d49b7e8f42cf873966b6756"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::main </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>the method responsible for tokenization </p>
<p>The main method is fully responsible for tokenizing the string stored in <a class="el" href="classScanner.html#a577a70297f4d3da0aa2ce4decc66eeea" title="Getter and setter for the source string.">string()</a> at the time of its call. By the time main returns, it should have consumed the whole of the string and populated the token array. </p>
<p>Reimplemented in <a class="el" href="classLuminousStatefulScanner.html#a7da6f0be6bafd50f0a785b6ba8e951aa">LuminousStatefulScanner</a>, and <a class="el" href="classLuminousSimpleScanner.html#a0962d46ec52780dd2f91a84e073ce654">LuminousSimpleScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a6efd3dada50a424d7f30b7f9afac5fc0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::map_identifier_filter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$token</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Identifier mapping filter. </p>
<p>Tries to map any 'IDENT' token to a TOKEN_NAME in <a class="el" href="classLuminousScanner.html#adb13455bbeb076cd0f031f050ef31a82" title="A map of identifiers and their corresponding token names.">LuminousScanner::$ident_map</a> This is implemented as the filter 'map-ident' </p>
</div>
</div>
<a class="anchor" id="ae974cbfb732f008a79482ffc4f11d398"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::nestable_token </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$token_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$open</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$close</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Handles tokens that may nest inside themselves. </p>
<p>Convenience function. It's fairly common for many languages to allow things like nestable comments. Handling these is easy but fairly long winded, so this function will take an opening and closing delimiter and consume the token until it is fully closed, or until the end of the string in the case that it is unterminated.</p>
<p>When the function returns, the token will have been consumed and appended to the token stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$token_name</td><td>the name of the token </td></tr>
<tr><td class="paramname">$open</td><td>the opening delimiter pattern (regex), e.g. '% /\* x' </td></tr>
<tr><td class="paramname">$close</td><td>the closing delimiter pattern (regex), e.g. '% \* /x'</td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Although PCRE provides recursive regular expressions, this function is far preferable. A recursive regex will easily crash PCRE on garbage input due to it having a fairly small stack: this function is much more resilient.</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">Exception</td><td>if called at a non-matching point (i.e. <code>$this-&gt;scan($open)</code> does not match) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a614e490335cf64375c52d57edfb398ad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::pop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pops the top element of the stack, and returns it. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">Exception</td><td>if the state stack is empty </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa61dbaafd8801e40094cbff52f7b22f1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::record </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$string</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$pre_escaped</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Records a string as a given token type. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$string</td><td>The string to record </td></tr>
<tr><td class="paramname">$type</td><td>The name of the token the string represents </td></tr>
<tr><td class="paramname">$pre_escaped</td><td>Luminous works towards getting this in XML and therefore at some point, the $string has to be escaped. If you have already escaped it for some reason (or if you got it from another scanner), then you want to set this to <code>TRUE</code> </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLuminousUtils.html#a25ba2a727a415d71c3d57fd03bdf95ea" title="Escapes a string suitable for use in XML.">LuminousUtils::escape_string</a> </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">Exception</td><td>if $string is <code>NULL</code> </td></tr>
</table>
</dd>
</dl>
<p>Reimplemented in <a class="el" href="classLuminousStatefulScanner.html#a04c01a23de9f1d42e5b4921879326ee4">LuminousStatefulScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a48fabeb9791b36ace2b46dd8f91a4afa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::record_range </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$to</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$type</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Helper function to record a range of the string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$from</td><td>the start index </td></tr>
<tr><td class="paramname">$to</td><td>the end index </td></tr>
<tr><td class="paramname">$type</td><td>the type of the token This is shorthand for <code> $this-&gt;record(substr($this-&gt;<a class="el" href="classScanner.html#a577a70297f4d3da0aa2ce4decc66eeea" title="Getter and setter for the source string.">string()</a>, $from, $to-$from)</code></td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">RangeException</td><td>if the range is invalid (i.e. $to &lt; $from)</td></tr>
</table>
</dd>
</dl>
<p>An empty range (i.e. $to === $from) is allowed, but it is essentially a no-op. </p>
<p>Reimplemented in <a class="el" href="classLuminousStatefulScanner.html#a9f8177050d802bad05d961c15b6a8536">LuminousStatefulScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a4cc936af136b39a54db6c7212c04cee7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::rule_mapper_filter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$tokens</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Rule re-mapper filter. </p>
<p>Re-maps token rules according to the LuminousScanner::rule_tag_map map. This is called as the filter 'rule-map' </p>
</div>
</div>
<a class="anchor" id="ab06dcdea11ff9a78168547b4c84c650c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::skip_whitespace </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Skips whitespace, and records it as a null token. </p>
<p>Convenience function </p>
</div>
</div>
<a class="anchor" id="a809c11561c650c7784edd3d06243b8b5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::tagged </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the XML representation of the token stream. </p>
<p>This function triggers the generation of the XML output. </p>
<dl class="section return"><dt>Returns</dt><dd>An XML-string which represents the tokens recorded by the scanner. </dd></dl>
<p>Reimplemented in <a class="el" href="classLuminousStatefulScanner.html#a22ca39b6b85a796a5438840fbddc7c0a">LuminousStatefulScanner</a>.</p>
</div>
</div>
<a class="anchor" id="ae381e3000c83ae4cb2259d0ae77a14ab"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::token_array </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the token array. </p>
<dl class="section return"><dt>Returns</dt><dd>The token array </dd></dl>
</div>
</div>
<a class="anchor" id="a463b3eb270a7afb960ee642bccc0d1b6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::user_def_filter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$token</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Filter to highlight identifiers whose definitions are in the source. </p>
<p>maps anything recorded in LuminousScanner::user_defs to the recorded type. This is called as the filter 'user-defs' </p>
</div>
</div>
<h2>Member Data Documentation</h2>
<a class="anchor" id="af3887911498a250b2cb1fe737dd87df1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$case_sensitive = true</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Whether or not the language is case sensitive. </p>
<p>Whether or not the scanner is dealing with a case sensitive language. This currently affects map_identifier_filter </p>
</div>
</div>
<a class="anchor" id="aca257c4da52076f42c6e53d9d0d33dd1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$filters = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Individual token filters. </p>
<p>A list of lists, each filter is an array: (name, token_name, callback) </p>
</div>
</div>
<a class="anchor" id="adb13455bbeb076cd0f031f050ef31a82"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$ident_map = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A map of identifiers and their corresponding token names. </p>
<p>A map of recognised identifiers, in the form identifier_string =&gt; TOKEN_NAME</p>
<p>This is currently used by map_identifier_filter </p>
</div>
</div>
<a class="anchor" id="a30aaa5d3076a9f28d00f167a1c4eac34"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$rule_tag_map = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Rule remappings. </p>
<p>A map to handle re-mapping of rules, in the form: OLD_TOKEN_NAME =&gt; NEW_TOKEN_NAME</p>
<p>This is used by <a class="el" href="classLuminousScanner.html#a4cc936af136b39a54db6c7212c04cee7" title="Rule re-mapper filter.">rule_mapper_filter()</a> </p>
</div>
</div>
<a class="anchor" id="ab5a30262ceb4324fdfaac1a7d217ba36"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$state_ = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>State stack. </p>
<p>A stack of the scanner's state, should the scanner wish to use a stack based state mechanism.</p>
<p>The top element can be retrieved (but not popped) with stack()</p>
<p>TODO More useful functions for manipulating the stack </p>
</div>
</div>
<a class="anchor" id="ad3d9ad7f7f14bc9de3dd6b68225ce21c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$stream_filters = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Token stream filters. </p>
<p>A list of lists, each filter is an array: (name, callback) </p>
</div>
</div>
<a class="anchor" id="ab29032700812b580e5d09b6128202286"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$tokens = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The token stream. </p>
<p>The token stream is recorded as a flat array of tokens. A token is made up of 3 parts, and stored as an array: </p>
<ul>
<li>0 =&gt; Token name </li>
<li>1 =&gt; Token string (from input source code) </li>
<li>2 =&gt; XML-Escaped? </li>
</ul>
</div>
</div>
<a class="anchor" id="a615d93f42d9290b9fad4d84cc2fd84ec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousScanner::$user_defs</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Identifier remappings based on definitions identified in the source code. </p>
<p>A map of remappings of user-defined types/functions. This is a map of identifier_string =&gt; TOKEN_NAME</p>
<p>This is used by <a class="el" href="classLuminousScanner.html#a463b3eb270a7afb960ee642bccc0d1b6" title="Filter to highlight identifiers whose definitions are in the source.">user_def_filter()</a> </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/core/<a class="el" href="scanner_8class_8php.html">scanner.class.php</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jan 12 2013 16:03:50 for Luminous by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>