« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 3 of about 3 for reduceId (0.002 sec.)
The Parle\Parser class | PHP 8.3 10603
The Parle\Parser class (PECL parle >= 0.5.1) はじめに Parser class. Rules can be defined on the fly. Once finalized, a Parle\Lexer instance is required to deliver the token stream. クラス概要 class Parle\Parser { /* 定数 */ const int ACTION ... nt ERROR_NON_ASSOCIATIVE = 1 ; const int ERROR_UNKNOWN_TOKEN = 2 ; /* プロパティ */ public int $ action = 0 ; public int $ reduceId = 0 ; /* メソッド */ public function advance (): void public function build (): void public function consume ( string $dat ... ser::ERROR_UNKNOWN_TOKEN プロパティ action Current parser action that matches one of the action class constants, readonly. reduceId Grammar rule id just processed in the reduce action. The value corresponds either to a token or to a production id. Readon ...
https://man.mtool.work/php/8.3/class.parle-parser.html
The Parle\RParser class | PHP 8.3 10603
The Parle\RParser class (PECL parle >= 0.7.0) はじめに Parser class. Rules can be defined on the fly. Once finalized, a Parle\RLexer instance is required to deliver the token stream. クラス概要 class Parle\RParser { /* 定数 */ const int ACT ... nt ERROR_NON_ASSOCIATIVE = 1 ; const int ERROR_UNKNOWN_TOKEN = 2 ; /* プロパティ */ public int $ action = 0 ; public int $ reduceId = 0 ; /* メソッド */ public function advance (): void public function build (): void public function consume ( string $dat ... ser::ERROR_UNKNOWN_TOKEN プロパティ action Current parser action that matches one of the action class constants, readonly. reduceId Grammar rule id just processed in the reduce action. The value corresponds either to a token or to a production id. Readon ...
https://man.mtool.work/php/8.3/class.parle-rparser.html
Parser examples | PHP 8.3 6659
Parser examples 例1 Simple calculator <?php use Parle \{ Parser , ParserException , Lexer , Token }; $p = new Parser ; $p -> token ( "INTEGER" ); $p -> left ( "'+' '-' '*' '/'" ); $p -> push ( "start" , "exp" ); $prod_add = $p -> push ( "ex ... N_SHIFT : case Parser :: ACTION_GOTO : case Parser :: ACTION_ACCEPT : break; case Parser :: ACTION_REDUCE : switch ( $p -> reduceId ) { case $prod_add : $l = $p -> sigil ( 0 ); $r = $p -> sigil ( 2 ); echo " $l + $r = " . ( $l + $r ) . "\n" ; break; case ... ACTION_SHIFT : case Parser :: ACTION_GOTO : /* var_dump($p->trace());*/ break; case Parser :: ACTION_REDUCE : $rid = $p -> reduceId (); if ( $rid == $prod_word_1 ) { var_dump ( $p -> sigil ( 0 )); } if ( $rid == $prod_word_0 ) { var_dump ( $p -> sigil ( ...
https://man.mtool.work/php/8.3/parle.examples.parser.html
PREV 1 NEXT