大网数据广告活动
PHP 语言与运行手册

The Parle\RParser class

· 52CE 我爱测

Parser class. Rules can be defined on the fly. Once finalized, a Parle\RLexer instance is required to deliver the token stream.

The Parle\RParser class

(PECL parle >= 0.7.0)

Introduction

Parser class. Rules can be defined on the fly. Once finalized, a Parle\RLexer instance is required to deliver the token stream.

Class synopsis

class Parle\RParser {
/* Constants */
const int ACTION_ERROR = 0;
const int ACTION_SHIFT = 1;
const int ACTION_REDUCE = 2;
const int ACTION_GOTO = 3;
const int ACTION_ACCEPT = 4;
const int ERROR_SYNTAX = 0;
/* Properties */
public int $action = 0;
public int $reduceId = 0;
/* Methods */
public function advance(): void
public function build(): void
public function consume(string $data, Parle\RLexer $rlexer): void
public function dump(): void
public function errorInfo(): Parle\ErrorInfo
public function left(string $tok): void
public function nonassoc(string $tok): void
public function precedence(string $tok): void
public function push(string $name, string $rule): int
public function reset(int $tokenId = ?): void
public function right(string $tok): void
public function sigil(int $idx = ?): string
public function sigilCount(): int
public function sigilName(int $idx): string
public function token(string $tok): void
public function tokenId(string $tok): int
public function trace(): string
public function validate(string $data, Parle\RLexer $lexer): bool
}

Properties

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. Readonly.

Table of Contents

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。