Parle\RParser::push

(PECL parle >= 0.7.0)

Parle\RParser::pushAdd a grammar rule

Description

public Parle\RParser::push(string $name, string $rule): int

Push a grammar rule. The production id returned can be used later in the parsing process to identify the rule matched.

Parameters

name

Rule name.

rule

The rule to be added. The syntax is Bison compatible.

Return Values

Returns int representing the rule index.