The Parle\Parser class

(PECL parle >= 0.5.1)

Introduction

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

Class synopsis

classParle\Parser {
constintACTION_ERROR = 0;
constintACTION_SHIFT = 1;
constintACTION_GOTO = 3;
constintERROR_SYNTAX = 0;
publicint$action = 0;
publicint$reduceId = 0;
publicadvance(): void
publicbuild(): void
publicconsume(string$data, Parle\Lexer$lexer): void
publicdump(): void
publicleft(string$tok): void
publicnonassoc(string$tok): void
publicprecedence(string$tok): void
publicpush(string$name, string$rule): int
publicreset(int$tokenId = ?): void
publicright(string$tok): void
publicsigil(int$idx): string
publicsigilCount(): int
publicsigilName(int$idx): string
publictoken(string$tok): void
publictokenId(string$tok): int
publictrace(): string
publicvalidate(string$data, Parle\Lexer$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

To Top