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

791 lines
44 KiB
HTML
Raw 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: LuminousStatefulScanner 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="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classLuminousStatefulScanner-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LuminousStatefulScanner Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Experimental transition table driven scanner.
<a href="classLuminousStatefulScanner.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for LuminousStatefulScanner:</div>
<div class="dyncontent">
<div class="center"><img src="classLuminousStatefulScanner__inherit__graph.png" border="0" usemap="#LuminousStatefulScanner_inherit__map" alt="Inheritance graph"/></div>
<map name="LuminousStatefulScanner_inherit__map" id="LuminousStatefulScanner_inherit__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for LuminousStatefulScanner:</div>
<div class="dyncontent">
<div class="center"><img src="classLuminousStatefulScanner__coll__graph.png" border="0" usemap="#LuminousStatefulScanner_coll__map" alt="Collaboration graph"/></div>
<map name="LuminousStatefulScanner_coll__map" id="LuminousStatefulScanner_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:a459218c633ecc5a0fb3d08e52e0a9c28"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a459218c633ecc5a0fb3d08e52e0a9c28">add_pattern</a> ($name, $pattern, $end=null, $consume=true)</td></tr>
<tr class="memdesc:a459218c633ecc5a0fb3d08e52e0a9c28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a pattern. <a href="#a459218c633ecc5a0fb3d08e52e0a9c28"></a><br/></td></tr>
<tr class="memitem:a6bbd65f0e100d22077501c800af7926a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a6bbd65f0e100d22077501c800af7926a">add_transition</a> ($from, $to)</td></tr>
<tr class="memdesc:a6bbd65f0e100d22077501c800af7926a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a state transition. <a href="#a6bbd65f0e100d22077501c800af7926a"></a><br/></td></tr>
<tr class="memitem:a0babe803eeec59e0a77f03c658a5e6b3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a0babe803eeec59e0a77f03c658a5e6b3">load_transitions</a> ()</td></tr>
<tr class="memdesc:a0babe803eeec59e0a77f03c658a5e6b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads legal state transitions for the current state. <a href="#a0babe803eeec59e0a77f03c658a5e6b3"></a><br/></td></tr>
<tr class="memitem:a7da6f0be6bafd50f0a785b6ba8e951aa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a7da6f0be6bafd50f0a785b6ba8e951aa">main</a> ()</td></tr>
<tr class="memitem:a132f05a948d43ec4cb103490cce2cedf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a132f05a948d43ec4cb103490cce2cedf">next_end_data</a> ()</td></tr>
<tr class="memdesc:a132f05a948d43ec4cb103490cce2cedf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Looks for the next state-pop sequence (close/end) for the current state. <a href="#a132f05a948d43ec4cb103490cce2cedf"></a><br/></td></tr>
<tr class="memitem:a33a49c8b634b1f9d6048a341b82efab3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a33a49c8b634b1f9d6048a341b82efab3">next_start_data</a> ()</td></tr>
<tr class="memdesc:a33a49c8b634b1f9d6048a341b82efab3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Looks for the next legal state transition. <a href="#a33a49c8b634b1f9d6048a341b82efab3"></a><br/></td></tr>
<tr class="memitem:ae4de8e437cdeb7cda6cb39b53427bd65"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#ae4de8e437cdeb7cda6cb39b53427bd65">pop_state</a> ()</td></tr>
<tr class="memdesc:ae4de8e437cdeb7cda6cb39b53427bd65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pops a state from the stack. <a href="#ae4de8e437cdeb7cda6cb39b53427bd65"></a><br/></td></tr>
<tr class="memitem:abd592ef2dce9cd10e790792b45218f3c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#abd592ef2dce9cd10e790792b45218f3c">push_child</a> ($child)</td></tr>
<tr class="memitem:a4ce70df919d944c9e85fce4072a27ff2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a4ce70df919d944c9e85fce4072a27ff2">push_state</a> ($state_data)</td></tr>
<tr class="memdesc:a4ce70df919d944c9e85fce4072a27ff2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushes a state. <a href="#a4ce70df919d944c9e85fce4072a27ff2"></a><br/></td></tr>
<tr class="memitem:a04c01a23de9f1d42e5b4921879326ee4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a04c01a23de9f1d42e5b4921879326ee4">record</a> ($str, $dummy1=null, $dummy2=null)</td></tr>
<tr class="memitem:a9f8177050d802bad05d961c15b6a8536"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a9f8177050d802bad05d961c15b6a8536">record_range</a> ($from, $to, $type=null)</td></tr>
<tr class="memdesc:a9f8177050d802bad05d961c15b6a8536"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function to record a range of the string. <a href="#a9f8177050d802bad05d961c15b6a8536"></a><br/></td></tr>
<tr class="memitem:a09266805f976b3fd9ee501bfebd69598"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a09266805f976b3fd9ee501bfebd69598">record_token</a> ($str, $type)</td></tr>
<tr class="memdesc:a09266805f976b3fd9ee501bfebd69598"><td class="mdescLeft">&#160;</td><td class="mdescRight">Records a complete token This is shorthand for pushing a new node onto the stack, recording its text, and then popping it. <a href="#a09266805f976b3fd9ee501bfebd69598"></a><br/></td></tr>
<tr class="memitem:a11c34191804f4842d49ab86be27000a0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a11c34191804f4842d49ab86be27000a0">state_name</a> ()</td></tr>
<tr class="memdesc:a11c34191804f4842d49ab86be27000a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the name of the current state. <a href="#a11c34191804f4842d49ab86be27000a0"></a><br/></td></tr>
<tr class="memitem:a22ca39b6b85a796a5438840fbddc7c0a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a22ca39b6b85a796a5438840fbddc7c0a">tagged</a> ()</td></tr>
<tr class="memdesc:a22ca39b6b85a796a5438840fbddc7c0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the XML representation of the token stream. <a href="#a22ca39b6b85a796a5438840fbddc7c0a"></a><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:aa33c01d00bf3a5f15fb0945deb742cec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#aa33c01d00bf3a5f15fb0945deb742cec">collapse_token_tree</a> ($node)</td></tr>
<tr class="memitem:a52c545680b3fe2f57c701957a6b52a84"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a52c545680b3fe2f57c701957a6b52a84">setup</a> ()</td></tr>
<tr class="memdesc:a52c545680b3fe2f57c701957a6b52a84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up the FSM. <a href="#a52c545680b3fe2f57c701957a6b52a84"></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:a33e625b6e207b9fa8d02306938480519"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a33e625b6e207b9fa8d02306938480519">$legal_transitions</a> = array()</td></tr>
<tr class="memdesc:a33e625b6e207b9fa8d02306938480519"><td class="mdescLeft">&#160;</td><td class="mdescRight">Legal transitions for the current state. <a href="#a33e625b6e207b9fa8d02306938480519"></a><br/></td></tr>
<tr class="memitem:acbb00a72f935a8c45261383760542b1d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#acbb00a72f935a8c45261383760542b1d">$patterns</a> = array()</td></tr>
<tr class="memdesc:acbb00a72f935a8c45261383760542b1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pattern list. <a href="#acbb00a72f935a8c45261383760542b1d"></a><br/></td></tr>
<tr class="memitem:aceb7c9c79698251183e07afb1ddf4228"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#aceb7c9c79698251183e07afb1ddf4228">$token_tree_stack</a> = array()</td></tr>
<tr class="memdesc:aceb7c9c79698251183e07afb1ddf4228"><td class="mdescLeft">&#160;</td><td class="mdescRight">The token tree. <a href="#aceb7c9c79698251183e07afb1ddf4228"></a><br/></td></tr>
<tr class="memitem:a74653deca3c7705eb06a250e7283060a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74653deca3c7705eb06a250e7283060a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a74653deca3c7705eb06a250e7283060a">$transitions</a> = array()</td></tr>
<tr class="memdesc:a74653deca3c7705eb06a250e7283060a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transition table. <br/></td></tr>
<tr class="inherit_header pro_attribs_classLuminousSimpleScanner"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classLuminousSimpleScanner')"><img src="closed.png" alt="-"/>&nbsp;Protected Attributes inherited from <a class="el" href="classLuminousSimpleScanner.html">LuminousSimpleScanner</a></td></tr>
<tr class="memitem:a6fe26909e26aeb6659a95bfbb8bb05d0 inherit pro_attribs_classLuminousSimpleScanner"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousSimpleScanner.html#a6fe26909e26aeb6659a95bfbb8bb05d0">$overrides</a> = array()</td></tr>
<tr class="memdesc:a6fe26909e26aeb6659a95bfbb8bb05d0 inherit pro_attribs_classLuminousSimpleScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overrides array. <a href="#a6fe26909e26aeb6659a95bfbb8bb05d0"></a><br/></td></tr>
<tr class="inherit_header pro_attribs_classLuminousScanner"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classLuminousScanner')"><img src="closed.png" alt="-"/>&nbsp;Protected Attributes inherited from <a class="el" href="classLuminousScanner.html">LuminousScanner</a></td></tr>
<tr class="memitem:af3887911498a250b2cb1fe737dd87df1 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Individual token filters. <a href="#aca257c4da52076f42c6e53d9d0d33dd1"></a><br/></td></tr>
<tr class="memitem:adb13455bbeb076cd0f031f050ef31a82 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rule remappings. <a href="#a30aaa5d3076a9f28d00f167a1c4eac34"></a><br/></td></tr>
<tr class="memitem:ab5a30262ceb4324fdfaac1a7d217ba36 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">State stack. <a href="#ab5a30262ceb4324fdfaac1a7d217ba36"></a><br/></td></tr>
<tr class="memitem:ad3d9ad7f7f14bc9de3dd6b68225ce21c inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Token stream filters. <a href="#ad3d9ad7f7f14bc9de3dd6b68225ce21c"></a><br/></td></tr>
<tr class="memitem:ab29032700812b580e5d09b6128202286 inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">The token stream. <a href="#ab29032700812b580e5d09b6128202286"></a><br/></td></tr>
<tr class="memitem:a615d93f42d9290b9fad4d84cc2fd84ec inherit pro_attribs_classLuminousScanner"><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 inherit pro_attribs_classLuminousScanner"><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><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ac48a7493e46607197259fabaa18196ad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#ac48a7493e46607197259fabaa18196ad">$last_state</a> = null</td></tr>
<tr class="memitem:a98a1d160d07f04e2ba8388e6b73db524"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a98a1d160d07f04e2ba8388e6b73db524">$setup</a> = false</td></tr>
<tr class="memitem:a58cb6b0100f05e310f90a8bf79608a3b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousStatefulScanner.html#a58cb6b0100f05e310f90a8bf79608a3b">$transition_rule_cache</a> = array()</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_classLuminousScanner"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classLuminousScanner')"><img src="closed.png" alt="-"/>&nbsp;Static Public Member Functions inherited from <a class="el" href="classLuminousScanner.html">LuminousScanner</a></td></tr>
<tr class="memitem:a094a64c9eb09e38ab43c865e1a4482c9 inherit pub_static_methods_classLuminousScanner"><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 inherit pub_static_methods_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">Language guessing. <a href="#a094a64c9eb09e38ab43c865e1a4482c9"></a><br/></td></tr>
<tr class="inherit_header pub_attribs_classLuminousScanner"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classLuminousScanner')"><img src="closed.png" alt="-"/>&nbsp;Public Attributes inherited from <a class="el" href="classLuminousScanner.html">LuminousScanner</a></td></tr>
<tr class="memitem:a22a1e366c9fbe4e837de693258c5c739 inherit pub_attribs_classLuminousScanner"><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 inherit pub_attribs_classLuminousScanner"><td class="mdescLeft">&#160;</td><td class="mdescRight">scanner version. <br/></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Experimental transition table driven scanner. </p>
<p>The stateful scanner follows a transition table and generates a hierarchical token tree. As such, the states follow a hierarchical parent-&gt;child relationship rather than a strict from-&gt;to</p>
<p>A node in the token tree looks like this:</p>
<div class="fragment"><div class="line">array(<span class="stringliteral">&#39;token_name&#39;</span> =&gt; <span class="stringliteral">&#39;name&#39;</span>,<span class="stringliteral">&#39;children&#39;</span> =&gt; array(...)) </div>
</div><!-- fragment --><p>Children is an ordered list and its elements may be either other token nodes or just strings. We override tagged to try to collapse this into XML while still applying filters.</p>
<p>We now store patterns as the following tuple: </p>
<div class="fragment"><div class="line">($name, $open_pattern, $teminate_pattern). </div>
</div><!-- fragment --><p> The termination pattern may be null, in which case the $open_pattern is complete. No transitions can occur within a complete state because the patterns' match is fixed.</p>
<p>We have two stacks. One is <a class="el" href="classLuminousStatefulScanner.html#aceb7c9c79698251183e07afb1ddf4228" title="The token tree.">LuminousStatefulScanner::$token_tree_stack</a>, which stores the token tree, and the other is a standard state stack which stores the current state data. State data is currently a pattern, as the above tuple.</p>
<dl class="section warning"><dt>Warning</dt><dd>Currently 'stream filters' are not applied, because we at no point end up with a flat stream of tokens. Although the rule name remapper is applied. </dd></dl>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="a459218c633ecc5a0fb3d08e52e0a9c28"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::add_pattern </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>$pattern</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$end</em> = <code>null</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$consume</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a pattern. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$name</td><td>the name of the pattern/state </td></tr>
<tr><td class="paramname">$pattern</td><td>Either the entire pattern, or just its opening delimiter </td></tr>
<tr><td class="paramname">$end</td><td>If $pattern was just the opening delimiter, $end is the closing delimiter. Separating the two delimiters like this makes the state flexible length, as state transitions can occur inside it. </td></tr>
<tr><td class="paramname">$consume</td><td>Not currently observed. Might never be. Don't specify this yet. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6bbd65f0e100d22077501c800af7926a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::add_transition </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>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a state transition. </p>
<p>This is a helper function for LuminousStatefulScanner::transitions, you can specify it directly instead </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$from</td><td>The parent state </td></tr>
<tr><td class="paramname">$to</td><td>The child state </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa33c01d00bf3a5f15fb0945deb742cec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::collapse_token_tree </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$node</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>Recursive function to collapse the token tree into XML </p>
</div>
</div>
<a class="anchor" id="a0babe803eeec59e0a77f03c658a5e6b3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::load_transitions </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads legal state transitions for the current state. </p>
<p>Loads in legal state transitions into the legal_transitions array according to the current state </p>
</div>
</div>
<a class="anchor" id="a7da6f0be6bafd50f0a785b6ba8e951aa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::main </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Generic main function which observes the transition table </p>
<p>Reimplemented from <a class="el" href="classLuminousSimpleScanner.html#a0962d46ec52780dd2f91a84e073ce654">LuminousSimpleScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a132f05a948d43ec4cb103490cce2cedf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::next_end_data </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Looks for the next state-pop sequence (close/end) for the current state. </p>
<dl class="section return"><dt>Returns</dt><dd>Data in the same format as get_next: a tuple of (next, matches). If no match is found, next is -1 and matches is null </dd></dl>
</div>
</div>
<a class="anchor" id="a33a49c8b634b1f9d6048a341b82efab3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::next_start_data </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Looks for the next legal state transition. </p>
<dl class="section return"><dt>Returns</dt><dd>A tuple of (pattern_data, next, matches). If no match is found, next is -1 and pattern_data and matches is null </dd></dl>
</div>
</div>
<a class="anchor" id="ae4de8e437cdeb7cda6cb39b53427bd65"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::pop_state </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pops a state from the stack. </p>
<p>The top token on the token_tree_stack is popped and appended as a child to the new top token.</p>
<p>The top state on the state stack is popped and discarded. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">Exception</td><td>if there is only the initial state on the stack (we cannot pop the initial state, because then we have no state at all) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="abd592ef2dce9cd10e790792b45218f3c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::push_child </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$child</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pushes a new token onto the stack as a child of the currently active token</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLuminousStatefulScanner.html#a4ce70df919d944c9e85fce4072a27ff2" title="Pushes a state.">push_state</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a4ce70df919d944c9e85fce4072a27ff2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::push_state </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$state_data</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Pushes a state. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$state_data</td><td>A tuple of ($name, $open_pattern, $teminate_pattern). This should be as it is stored in LuminousStatefulScanner::patterns</td></tr>
</table>
</dd>
</dl>
<p>This actually causes two push operations. One is onto the token_tree_stack, and the other is onto the actual stack. The former creates a new token, the latter is used for state information </p>
</div>
</div>
<a class="anchor" id="a04c01a23de9f1d42e5b4921879326ee4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::record </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$dummy1</em> = <code>null</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$dummy2</em> = <code>null</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 child of the currently active token </p>
<dl class="section warning"><dt>Warning</dt><dd>the second and third parameters are not applicable to this method, they are only present to suppress PHP warnings. If you set them, an exception is thrown. </dd></dl>
<p>Reimplemented from <a class="el" href="classLuminousScanner.html#aa61dbaafd8801e40094cbff52f7b22f1">LuminousScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a9f8177050d802bad05d961c15b6a8536"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::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> = <code>null</code>&#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>dummy argument 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 from <a class="el" href="classLuminousScanner.html#a48fabeb9791b36ace2b46dd8f91a4afa">LuminousScanner</a>.</p>
</div>
</div>
<a class="anchor" id="a09266805f976b3fd9ee501bfebd69598"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::record_token </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$str</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>Records a complete token This is shorthand for pushing a new node onto the stack, recording its text, and then popping it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$str</td><td>the string </td></tr>
<tr><td class="paramname">$type</td><td>the token type </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a52c545680b3fe2f57c701957a6b52a84"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::setup </td>
<td>(</td>
<td class="paramname"></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>Sets up the FSM. </p>
<p>If the caller has omitted to specify an initial state then one is created, with valid transitions to all other known states. We also push the initial state onto the tree stack, and add a type mapping from the initial type to <code>NULL</code>. </p>
</div>
</div>
<a class="anchor" id="a11c34191804f4842d49ab86be27000a0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::state_name </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the name of the current state. </p>
<dl class="section return"><dt>Returns</dt><dd>The name of the current state </dd></dl>
</div>
</div>
<a class="anchor" id="a22ca39b6b85a796a5438840fbddc7c0a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::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 from <a class="el" href="classLuminousScanner.html#a809c11561c650c7784edd3d06243b8b5">LuminousScanner</a>.</p>
</div>
</div>
<h2>Member Data Documentation</h2>
<a class="anchor" id="ac48a7493e46607197259fabaa18196ad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$last_state = null</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>remembers the state on the last iteration so we know whether or not to load in a new transition-set </p>
</div>
</div>
<a class="anchor" id="a33e625b6e207b9fa8d02306938480519"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$legal_transitions = 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>Legal transitions for the current state. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLuminousStatefulScanner.html#a0babe803eeec59e0a77f03c658a5e6b3" title="Loads legal state transitions for the current state.">LuminousStatefulScanner::load_transitions()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="acbb00a72f935a8c45261383760542b1d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$patterns = 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>Pattern list. </p>
<p>Pattern array. Each pattern is a tuple of </p>
<div class="fragment"><div class="line">($name, $open_pattern, $teminate_pattern) </div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a98a1d160d07f04e2ba8388e6b73db524"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$setup = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Records whether or not the FSM has been set up for the first time. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLuminousStatefulScanner.html#a52c545680b3fe2f57c701957a6b52a84" title="Sets up the FSM.">setup()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aceb7c9c79698251183e07afb1ddf4228"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$token_tree_stack = 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 tree. </p>
<p>The tokens we end up with are a tree which we build as we go along. The easiest way to build it is to keep track of the currently active node on top of a stack. When the node is completed, we pop it and insert it as a child of the element which is now at the top of the stack.</p>
<p>At the end of the process we end up with one element in here which is the root node. </p>
</div>
</div>
<a class="anchor" id="a58cb6b0100f05e310f90a8bf79608a3b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">LuminousStatefulScanner::$transition_rule_cache = array()</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Cache of transition rules </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLuminousStatefulScanner.html#a33a49c8b634b1f9d6048a341b82efab3" title="Looks for the next legal state transition.">next_start_data()</a> </dd></dl>
</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>