PHP 8.5.0 Released!

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 advance (): void
public build (): void
public consume (string $data, Parle\RLexer $rlexer): void
public dump (): void
public left (string $tok): void
public nonassoc (string $tok): void
public precedence (string $tok): void
public push (string $name, string $rule): int
public reset (int $tokenId = ?): void
public right (string $tok): void
public sigil (int $idx = ?): string
public sigilCount (): int
public sigilName (int $idx): string
public token (string $tok): void
public tokenId (string $tok): int
public trace (): string
public 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

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /