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

Parle\Lexer::push

(PECL parle >= 0.5.1)

Parle\Lexer::push — Add a lexer rule

说明

public Parle\Lexer::push ( string $regex , int $id ) : void

Push a pattern for lexeme recognition.

参数

regex

Regular expression used for token matching.

id

Token id. If the lexer instance is meant to be used standalone, this can be an arbitrary number. If the lexer instance is going to be passed to the parser, it has to be an id returned by Parle\Parser::tokenid().

返回值

没有返回值。

相关文章
php parle the parle lexer classphp parle lexer process next lexer rulephp parle lexer finalize the lexer rule setphp parle lexer define token callbackphp parle lexer dump the state machinephp parle lexer retrieve the current tokenphp parle lexer insert regex macrophp parle lexer add a lexer rulephp parle lexer reset lexerphp parle parser process next parser rulephp parle parser declare a precedence rulephp 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 rlexer reset lexerphp parle rparser declare a precedence rulephp parle rparser add a grammar rulephp parle rparser retrieve a matching part of a rule
关注编程学问公众号
编程学问网 湘ICP备20001732号