Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 11150

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>Add a lexer rule</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parle-rlexer.insertmacro.html">Parle\RLexer::insertMacro</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="parle-rlexer.pushstate.html">Parle\RLexer::pushState</a></div>
 <div class="up"><a href="class.parle-rlexer.html">Parle\RLexer</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="parle-rlexer.push" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Parle\RLexer::push</h1>
  <p class="verinfo">(PECL parle &gt;= 0.5.1)</p><p class="refpurpose"><span class="refname">Parle\RLexer::push</span> &mdash; <span class="dc-title">Add a lexer rule</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-parle-rlexer.push-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>Parle\RLexer::push</strong></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"><span class="type void">void</span></span> <span class="methodname"><strong>Parle\RLexer::push</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$state</code></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>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$newState</code></span>
   
   )</div>

  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>Parle\RLexer::push</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$state</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$regex</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$newState</code></span>
   )</div>

  <p class="para rdfs-comment">
   Push a pattern for lexeme recognition.
  </p>
  <p class="para">A &#039;start state&#039; and &#039;exit state&#039; can be specified by using a suitable signature. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-parle-rlexer.push-parameters">
  <h3 class="title">Parameters</h3>
  <dl>

   
    <dt>
<code class="parameter">regex</code></dt>

    <dd>

     <p class="para">
      Regular expression used for token matching.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">id</code></dt>

    <dd>

     <p class="para">
      Token id. If the lexer instance is meant to be used standalone, this can be an arbitrary number. If the lexer instance is going to be passed to the parser, it has to be an id returned by <span class="methodname"><a href="parle-rparser.tokenid.html" class="methodname">Parle\RParser::tokenid()</a></span>.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">state</code></dt>

    <dd>

     <p class="para">
      State name. If &#039;*&#039; is used as start state, then the rule is applied to all lexer states.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">newState</code></dt>

     <dd>

      <p class="para">
       New state name, after the rule was applied.
      </p>
      <p class="para">
       If &#039;.&#039; is specified as the exit state, then the lexer state is unchanged when that rule matches. An exit state with &#039;&gt;&#039; before the name means push. Use the signature without id for either continuation or to start matching, when a continuation or recursion is required.
      </p>
      <p class="para">
       If &#039;&lt;&#039; is specified as exit state, it means pop. In that case, the signature containing the id can be used to identify the match. Note that even in the case an id is specified, the rule will finish first when all the previous pushes popped.
      </p>
     </dd>

   
   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-parle-rlexer.push-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.   
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parle-rlexer.insertmacro.html">Parle\RLexer::insertMacro</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="parle-rlexer.pushstate.html">Parle\RLexer::pushState</a></div>
 <div class="up"><a href="class.parle-rlexer.html">Parle\RLexer</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>