The Parle\Parser class
(PECL parle >= 0.5.1)
简介
Parser class. Rules can be defined on the fly. Once finalized, a Parle\Lexer instance is required to deliver the token stream.
类摘要
Parle\Parser
{
public void build
(
void
)
public void consume
(
string $data
,
Parle\Lexer $lexer
)
public void dump
(
void
)
public void left
(
string $tok
)
public int push
(
string $name
,
string $rule
)
public void reset
([
integer $tokenId
] )
public void right
(
string $tok
)
public string sigil
([
integer $idx
] )
public void token
(
string $tok
)
public string trace
(
void
)
public bool validate
(
string $data
,
Parle\Lexer $lexer
)
}
预定义常量
Parle\Parser::ACTION_ERROR
-
Parle\Parser::ACTION_SHIFT
-
Parle\Parser::ACTION_REDUCE
-
Parle\Parser::ACTION_GOTO
-
Parle\Parser::ACTION_ACCEPT
-
Parle\Parser::ERROR_SYNTAX
-
Parle\Parser::ERROR_NON_ASSOCIATIVE
-
Parle\Parser::ERROR_UNKOWN_TOKEN
-
属性
- action
-
Current parser action that matches one of the action class constants, readonly.
- reduceId
-
Grammar rule id just processed in the reduce action. The value corresponds either to a token or to a production id. Readonly.
Table of Contents
User Contributed Notes
There are no user contributed notes for this page.