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

Parle\Parser::push

(PECL parle >= 0.5.1)

Parle\Parser::push — Add a grammar rule

说明

public Parle\Parser::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 parser classphp bbcode 函数 attach another parser in order to use another rule set for argument parsingphp parle lexer process next lexer rulephp parle lexer finalize the lexer rule setphp parle lexer add a lexer rulephp parle parser process next parser rulephp parle parser finalize the grammar rulesphp parle parser dump the grammarphp parle parser declare a token with no associativityphp parle parser declare a precedence rulephp parle parser add a grammar rulephp parle parser reset parser statephp parle parser declare a token with right associativityphp parle parser retrieve a matching part of a rulephp parle parser declare a tokenphp parle rlexer add a lexer rulephp parle rparser process next parser rulephp parle rparser finalize the grammar rulesphp parle rparser add a grammar rulephp parle rparser trace the parser operation
关注编程学问公众号
编程学问网 湘ICP备20001732号