[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/parle/parle/rlexer/_push.xml_pushstate.xml?=
From:       Anatol_Belski <ab () php ! net>
Date:       2017-11-06 21:47:37
Message-ID: svn-ab-1510004857-343376-165527949 () svn ! php ! net
[Download RAW message or body]

ab                                       Mon, 06 Nov 2017 21:47:37 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=343376

Log:
Improve doc on RLexer::push() and RLexer::pushState()

Changed paths:
    U   phpdoc/en/trunk/reference/parle/parle/rlexer/push.xml
    U   phpdoc/en/trunk/reference/parle/parle/rlexer/pushstate.xml

Modified: phpdoc/en/trunk/reference/parle/parle/rlexer/push.xml
===================================================================
--- phpdoc/en/trunk/reference/parle/parle/rlexer/push.xml	2017-11-06 20:27:03 UTC \
                (rev 343375)
+++ phpdoc/en/trunk/reference/parle/parle/rlexer/push.xml	2017-11-06 21:47:37 UTC \
(rev 343376) @@ -32,6 +32,8 @@
   <para>
    Push a pattern for lexeme recognition.
   </para>
+  <para>A 'start state' and 'exit state' can be specified by using a suitable \
signature. +  </para>
  </refsect1>

  <refsect1 role="parameters">
@@ -57,7 +59,7 @@
     <term><parameter>state</parameter></term>
     <listitem>
      <para>
-      State name.
+      State name. If '*' is used as start state, then the rule is applied to all \
lexer states.  </para>
     </listitem>
    </varlistentry>
@@ -67,6 +69,12 @@
       <para>
        New state name, after the rule was applied.
       </para>
+      <para>
+       If '.' is specified as the exit state, then the lexer state is unchanged when \
that rule matches. An exit state with '&gt;' before the name means push. Use the \
signature without id for either continuation or to start matching, when a \
continuation or recursion is required. +      </para>
+      <para>
+       If '&lt;' 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. +      </para>
      </listitem>
    </varlistentry>
    <!--<varlistentry>

Modified: phpdoc/en/trunk/reference/parle/parle/rlexer/pushstate.xml
===================================================================
--- phpdoc/en/trunk/reference/parle/parle/rlexer/pushstate.xml	2017-11-06 20:27:03 \
                UTC (rev 343375)
+++ phpdoc/en/trunk/reference/parle/parle/rlexer/pushstate.xml	2017-11-06 21:47:37 \
UTC (rev 343376) @@ -14,7 +14,7 @@
    <methodparam><type>string</type><parameter>state</parameter></methodparam>
   </methodsynopsis>
   <para>
-   This lexer type can have more than one state machine. This allows you to lex \
different tokens depending on context, thus allowing simple parsing to take place. To \
allow this, a 'start state' must be specified additionally at the beginning of the \
<methodname>Parle\RLexer::push</methodname> call and an 'exit state' at the end. If \
'*' is used as start state, then the rule is applied to all lexer states. If '.' is \
specified as the exit state, then the lexer state is unchanged when that rule \
matches. +	  This lexer type can have more than one state machine. This allows you to \
lex different tokens depending on context, thus allowing simple parsing to take \
place. Once a state pushed, it can be used with a suitable \
<methodname>Parle\RLexer::push</methodname> signature variant.  </para>
  </refsect1>



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic