Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 1046

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Parle\Lexer class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parle.examples.parser.html">Parser examples</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="parle-lexer.advance.html">Parle\Lexer::advance</a></div>
 <div class="up"><a href="book.parle.html">Parle</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.parle-lexer" class="reference">

 <h1 class="title">The Parle\Lexer class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL parle &gt;= 0.5.1)</p>


  <div class="section" id="parle-lexer.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    Single state lexer class. Lexemes can be defined on the fly. If the particular lexer instance is meant to be used with <a href="class.parle-parser.html" class="classname">Parle\Parser</a>, the token IDs need to be taken from there. Otherwise, arbitrary token IDs can be supplied. This lexer can give a certain performance advantage over <a href="class.parle-rlexer.html" class="classname">Parle\RLexer</a>, if no multiple states are required. Note, that <a href="class.parle-rparser.html" class="classname">Parle\RParser</a> is not compatible with this lexer.
   </p>
  </div>


  <div class="section" id="parle-lexer.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Parle\Lexer</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.parle-lexer.html#parle-lexer.constants.flag-regex-icase"><var class="varname">ICASE</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.parle-lexer.html#parle-lexer.constants.flag-regex-dot-not-lf"><var class="varname">DOT_NOT_LF</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.parle-lexer.html#parle-lexer.constants.flag-regex-dot-not-cr-lf"><var class="varname">DOT_NOT_CRLF</var></a></var>
     <span class="initializer"> = 4</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.parle-lexer.html#parle-lexer.constants.flag-regex-skip-ws"><var class="varname">SKIP_WS</var></a></var>
     <span class="initializer"> = 8</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.parle-lexer.html#parle-lexer.constants.flag-regex-match-zero-len"><var class="varname">MATCH_ZERO_LEN</var></a></var>
     <span class="initializer"> = 16</span>
    ;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">boolean</span>
      <var class="varname"><a href="class.parle-lexer.html#parle-lexer.props.bol">$<var class="varname">bol</var></a></var>
     <span class="initializer"> = <strong><code>FALSE</code></strong></span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">integer</span>
      <var class="varname"><a href="class.parle-lexer.html#parle-lexer.props.flags">$<var class="varname">flags</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">integer</span>
      <var class="varname"><a href="class.parle-lexer.html#parle-lexer.props.state">$<var class="varname">state</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">integer</span>
      <var class="varname"><a href="class.parle-lexer.html#parle-lexer.props.marker">$<var class="varname">marker</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">integer</span>
      <var class="varname"><a href="class.parle-lexer.html#parle-lexer.props.cursor">$<var class="varname">cursor</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.advance.html" class="methodname">advance</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.build.html" class="methodname">build</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.callout.html" class="methodname">callout</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$id</code></span>
   , <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.consume.html" class="methodname">consume</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.dump.html" class="methodname">dump</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
      <span class="modifier">public</span> <span class="type">Parle\Token</span> <span class="methodname"><a href="parle-lexer.gettoken.html" class="methodname">getToken</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.insertmacro.html" class="methodname">insertMacro</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$regex</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.push.html" class="methodname">push</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$regex</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$id</code></span>
   
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="parle-lexer.reset.html" class="methodname">reset</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$pos</code></span>
   )</div>

   }</div>


  </div>
  

  <div class="section" id="parle-lexer.constants">
   <h2 class="title">Predefined Constants</h2>
   <dl>


    
     <dt id="parle-lexer.constants.flag-regex-icase"><strong><code>Parle\Lexer::ICASE</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="parle-lexer.constants.flag-regex-dot-not-lf"><strong><code>Parle\Lexer::DOT_NOT_LF</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="parle-lexer.constants.flag-regex-dot-not-cr-lf"><strong><code>Parle\Lexer::DOT_NOT_CRLF</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="parle-lexer.constants.flag-regex-skip-ws"><strong><code>Parle\Lexer::SKIP_WS</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="parle-lexer.constants.flag-regex-match-zero-len"><strong><code>Parle\Lexer::MATCH_ZERO_LEN</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

   </dl>

  </div>



  <div class="section" id="parle-lexer.props">
   <h2 class="title">Properties</h2>
   <dl>

    
     <dt id="parle-lexer.props.bol"><var class="varname"><var class="varname">bol</var></var></dt>

     <dd>

      <p class="para">Start of input flag.</p>
     </dd>

    
    
     <dt id="parle-lexer.props.flags"><var class="varname"><var class="varname">flags</var></var></dt>

     <dd>

      <p class="para">Lexer flags.</p>
     </dd>

    
    
     <dt id="parle-lexer.props.state"><var class="varname"><var class="varname">state</var></var></dt>

     <dd>

      <p class="para">Current lexer state, readonly.</p>
     </dd>

    
    
     <dt id="parle-lexer.props.marker"><var class="varname"><var class="varname">marker</var></var></dt>

     <dd>

      <p class="para">Position of the latest token match, readonly.</p>
     </dd>

    
    
     <dt id="parle-lexer.props.cursor"><var class="varname"><var class="varname">cursor</var></var></dt>

     <dd>

      <p class="para">Current input offset, readonly.</p>
     </dd>

    
   </dl>

  </div>


 </div>

 
 
































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="parle-lexer.advance.html">Parle\Lexer::advance</a> — Process next lexer rule</li><li><a href="parle-lexer.build.html">Parle\Lexer::build</a> — Finalize the lexer rule set</li><li><a href="parle-lexer.callout.html">Parle\Lexer::callout</a> — Define token callback</li><li><a href="parle-lexer.consume.html">Parle\Lexer::consume</a> — Pass the data for processing</li><li><a href="parle-lexer.dump.html">Parle\Lexer::dump</a> — Dump the state machine</li><li><a href="parle-lexer.gettoken.html">Parle\Lexer::getToken</a> — Retrieve the current token</li><li><a href="parle-lexer.insertmacro.html">Parle\Lexer::insertMacro</a> — Insert regex macro</li><li><a href="parle-lexer.push.html">Parle\Lexer::push</a> — Add a lexer rule</li><li><a href="parle-lexer.reset.html">Parle\Lexer::reset</a> — Reset lexer</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parle.examples.parser.html">Parser examples</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="parle-lexer.advance.html">Parle\Lexer::advance</a></div>
 <div class="up"><a href="book.parle.html">Parle</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>