编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « Parle\RParser::precedence
  • Parle\RParser::reset »
  • PHP Manual
  • Parle\RParser
  • Add a grammar rule

Parle\RParser::push

(PECL parle >= 0.7.0)

Parle\RParser::push — Add a grammar rule

说明

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.

参数

name

Rule name.

rule

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

返回值

Returns integer representing the rule index.

相关文章
php parle the parle rparser classphp parle lexer add a lexer rulephp parle parser process next parser rulephp parle parser finalize the grammar rulesphp parle parser add a grammar rulephp parle parser retrieve a matching part of a rulephp parle rlexer process next lexer rulephp parle rlexer finalize the lexer rule setphp parle rlexer add a lexer rulephp parle rparser process next parser rulephp parle rparser finalize the grammar rulesphp parle rparser consume the data for processingphp parle rparser dump the grammarphp parle rparser retrieve the error informationphp parle rparser declare a token with left associativityphp parle rparser declare a token with no associativityphp parle rparser declare a precedence rulephp parle rparser add a grammar rulephp parle rparser retrieve a matching part of a rulephp parle rparser validate input
关注编程学问公众号
编程学问网 湘ICP备20001732号