From 51e87973080d93d6db2d69ac5ffcd4115b1a81d5 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 6 Nov 2017 21:47:37 +0000 Subject: [PATCH] Improve doc on RLexer::push() and RLexer::pushState() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343376 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/parle/parle/rlexer/push.xml | 10 +++++++++- reference/parle/parle/rlexer/pushstate.xml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/parle/parle/rlexer/push.xml b/reference/parle/parle/rlexer/push.xml index 4d44d6ea49..7cd64c07d2 100644 --- a/reference/parle/parle/rlexer/push.xml +++ b/reference/parle/parle/rlexer/push.xml @@ -32,6 +32,8 @@ Push a pattern for lexeme recognition. + A 'start state' and 'exit state' can be specified by using a suitable signature. + @@ -57,7 +59,7 @@ state - State name. + State name. If '*' is used as start state, then the rule is applied to all lexer states. @@ -67,6 +69,12 @@ New state name, after the rule was applied. + + If '.' is specified as the exit state, then the lexer state is unchanged when that rule matches. An exit state with '>' before the name means push. Use the signature without id for either continuation or to start matching, when a continuation or recursion is required. + + + If '<' 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. +