php[tek] 2018 : Call for Speakers

The Parle\RParser class

(PECL parle >= 0.7.0)

Introducción

Parser class. Rules can be defined on the fly. Once finalized, a Parle\RLexer instance is required to deliver the token stream.

Sinopsis de la Clase

Parle\RParser {
/* Constants */
const integer ACTION_ERROR = 0 ;
const integer ACTION_SHIFT = 1 ;
const integer ACTION_REDUCE = 2 ;
const integer ACTION_GOTO = 3 ;
const integer ACTION_ACCEPT = 4 ;
const integer ERROR_SYNTAX = 0 ;
const integer ERROR_NON_ASSOCIATIVE = 1 ;
const integer ERROR_UNKOWN_TOKEN = 2 ;
/* Propiedades */
public integer $action = 0 ;
public integer $reduceId = 0 ;
/* Métodos */
public void advance ( void )
public void build ( void )
public void consume ( string $data , Parle\RLexer $rlexer )
public void dump ( void )
public Parle\ErrorInfo errorInfo ( void )
public void left ( string $tok )
public void nonassoc ( string $tok )
public void precedence ( 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 int tokenId ( string $tok )
public string trace ( void )
public bool validate ( string $data , Parle\RLexer $lexer )
}

Constantes predefinidas

Parle\RParser::ACTION_ERROR

Parle\RParser::ACTION_SHIFT

Parle\RParser::ACTION_REDUCE

Parle\RParser::ACTION_GOTO

Parle\RParser::ACTION_ACCEPT

Parle\RParser::ERROR_SYNTAX

Parle\RParser::ERROR_NON_ASSOCIATIVE

Parle\RParser::ERROR_UNKOWN_TOKEN

Propiedades

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.

Tabla de contenidos

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top