mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Adapt example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343093 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
95187969ac
commit
76f007a25f
1 changed files with 4 additions and 10 deletions
|
@ -123,9 +123,7 @@ foreach ($exp as $in) {
|
|||
|
||||
$p->consume($in, $lex);
|
||||
|
||||
$act = $p->action();
|
||||
|
||||
while (Parser::ACTION_ERROR != $act && Parser::ACTION_ACCEPT != $act) {
|
||||
while (Parser::ACTION_ERROR != $p->action && Parser::ACTION_ACCEPT != $p->action) {
|
||||
switch ($act) {
|
||||
case Parser::ACTION_ERROR:
|
||||
throw new ParserException("Parser error");
|
||||
|
@ -135,9 +133,7 @@ foreach ($exp as $in) {
|
|||
case Parser::ACTION_ACCEPT:
|
||||
break;
|
||||
case Parser::ACTION_REDUCE:
|
||||
$rid = $p->reduceId();
|
||||
|
||||
switch ($rid) {
|
||||
switch ($p->reduceId) {
|
||||
case $add_idx:
|
||||
$l = $p->sigil(0);
|
||||
$r = $p->sigil(2);
|
||||
|
@ -162,7 +158,6 @@ foreach ($exp as $in) {
|
|||
break;
|
||||
}
|
||||
$p->advance();
|
||||
$act = $p->action();
|
||||
}
|
||||
}
|
||||
]]>
|
||||
|
@ -192,8 +187,7 @@ $lex->build();
|
|||
$in = "Dis-moi où est ton papa?";
|
||||
$p->consume($in, $lex);
|
||||
do {
|
||||
$act = $p->action();
|
||||
switch ($act) {
|
||||
switch ($p->action) {
|
||||
case Parser::ACTION_ERROR:
|
||||
throw new ParserException("Error");
|
||||
break;
|
||||
|
@ -212,7 +206,7 @@ do {
|
|||
break;
|
||||
}
|
||||
$p->advance();
|
||||
} while (Parser::ACTION_ERROR != $act && Parser::ACTION_ACCEPT != $act);
|
||||
} while (Parser::ACTION_ERROR != $p->action && Parser::ACTION_ACCEPT != $p->action);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue