« Parle\RLexer::reset
Parle\Parser::advance »

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_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;
/* プロパティ */
public int $action = 0;
public int $reduceId = 0;
/* メソッド */
public function advance(): void
public function build(): void
public function consume(string $data, Parle\Lexer $lexer): 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\Lexer $lexer): bool
}

プロパティ

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.

目次

関連キーワード:
Parle   Parser   token   rule   action   Declare   parser   reset   advance   Lexer   left   precedence   tokenId   right   grammar   Retrieve   associativity   定数   プロパティ   reduceId   build   consume   lexer   dump   errorInfo
関連する関数・ページ:
class.parle-rparser   parle-parser.token   parle-parser.tokenid   parle-parser.sigilname   parle-parser.nonassoc   book.parle