编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 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 lexer process next lexer rulephp parle lexer finalize the lexer rule setphp parle lexer add a lexer rulephp parle parser finalize the grammar rulesphp parle parser dump the grammarphp parle parser declare a precedence rulephp parle parser add a grammar 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 dump the grammarphp parle rparser declare a precedence rulephp parle rparser add a grammar rulephp parle rparser reset parser statephp parle rparser declare a token with right associativityphp parle rparser retrieve a matching part of a rulephp parle rparser declare a tokenphp parle rparser get token idphp parle rparser trace the parser operation
关注编程学问公众号
编程学问网 湘ICP备20001732号